diff --git a/.classpath b/.classpath deleted file mode 100644 index 512a74ba..00000000 --- a/.classpath +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.directory b/.directory deleted file mode 100644 index 0a926dd5..00000000 --- a/.directory +++ /dev/null @@ -1,4 +0,0 @@ -[Dolphin] -Timestamp=2015,9,8,20,39,49 -Version=3 -ViewMode=1 diff --git a/.gitignore b/.gitignore index dc47dc6a..6633be8c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,35 @@ -*.class +### JetBrains template +.idea/ /classes* /product* -/bin* +out/ .directory -.settings \ No newline at end of file +.settings + +## File-based project format: +*.iws +*.iml + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +### Java template +*.class +*.log +# Package Files # +*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* +### Gradle template +.gradle +/build/ + +# Ignore Gradle GUI config +gradle-app.setting + +# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) +!gradle-wrapper.jar + +# Cache of project +.gradletasknamecache diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml deleted file mode 100644 index c4c95431..00000000 --- a/.idea/codeStyleSettings.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 96cc43ef..9c276ab9 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,22 +1,9 @@ - - - - - - - - - - - - - - - - - + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml deleted file mode 100644 index 049cafef..00000000 --- a/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/copyright/sdrtrunk.xml b/.idea/copyright/sdrtrunk.xml deleted file mode 100644 index d2ce33df..00000000 --- a/.idea/copyright/sdrtrunk.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/dictionaries/denny.xml b/.idea/dictionaries/denny.xml deleted file mode 100644 index 223a1c26..00000000 --- a/.idea/dictionaries/denny.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - bahroo - broadcastify - esnid - fleetsync - icecast - ident - overflowable - polyphase - remez - samplerate - sdrtrunk - sheirer - shoutcast - streamable - talkgroup - tgid - ultravox - wacn - xtea - - - \ No newline at end of file diff --git a/.idea/libraries/imports.xml b/.idea/libraries/imports.xml deleted file mode 100644 index 91ffaa83..00000000 --- a/.idea/libraries/imports.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/org_asynchttpclient_async_http_client_2_0_18.xml b/.idea/libraries/org_asynchttpclient_async_http_client_2_0_18.xml deleted file mode 100644 index 884ea3f9..00000000 --- a/.idea/libraries/org_asynchttpclient_async_http_client_2_0_18.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 2c55e21a..05483570 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,43 +1,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.idea/modules.xml b/.idea/modules.xml index 071dc2cc..f67d0d5b 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,7 +2,9 @@ - + + + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml deleted file mode 100644 index e96534fb..00000000 --- a/.idea/uiDesigner.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 35eb1ddf..94a25f7f 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.project b/.project deleted file mode 100644 index 7accc076..00000000 --- a/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - sdrtrunk - - - - - - org.eclipse.xtext.ui.shared.xtextBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.xtext.ui.shared.xtextNature - - diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index a698e596..00000000 --- a/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,12 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.8 diff --git a/CHANGELOG b/CHANGELOG index 513601f7..1d2e0655 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +0.4.0 ........ (in progress) + - Changes build system from ant to gradle. Thanks to: Roman Tsypuk https://github.com/tsypuk + 0.3.2 20171105 - Resolves issue with tuner frequency adjustments that was causing channel processing to lockup and show persistent 'overflow' state in each channel status @@ -43,7 +46,7 @@ - Updated Baseband (I/Q) recording at 48 kHz - Added Airspy tuner support - New traffic channel pool manager for trunked call following - - P25 Decoder for C4FM and LSM with trunked call following and audio + - P25 Decoder for C4FM and LSM with trunked call following and audio decoding via the JMBE library - Updated MPT1327 decoder and trunked call following. - Updated spectral and waterfall display with zoom (2-64x) and pan and automatic diff --git a/README.md b/README.md index f8a2fa96..3b10f06e 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,47 @@ A cross-platform java application for decoding, monitoring, recording and stream ![sdrtrunk Application Overview - Version 0.3.0](https://github.com/DSheirer/sdrtrunk/wiki/images/ApplicationOverview_V0.3.0.png) **Figure 1:** sdrtrunk **Version 0.3.0** Application Screenshot + +# Instructions: +## Build the project +Project uses gradle as build system. You can build it with locally installed gradle or if you do not have/want install gradle you can use preconfigured linux/windows wrapper. +### Build with locally installed gradle 4.3.1 +``` +gradle clean buildSdr +``` +### Build with preconfigured wrapper for linux/windows +Linux +``` +./gradlew clean buildSdr +``` +Windows +``` +gradle.bat clean buildSdr +``` +This would add gradle, download all project dependencies and build JAR + +## Development +All dependencies/versions are controlled from build.gradle. +To change the new release version tag of artifact - change property: +``` +version = '0.3.2' +``` + +## Run SDRTrunk +SDRTrunk is packed into single uber-jar file. There is need to have folders with dependecies and +adding them with classpath. Just run with java. +### Use Java8 +``` +java -jar build/libs/sdr-trunk-all-0.3.2.jar +``` + +## TODO ITEMS + +- [x] Move project to gradle build +- [x] Changed folders structure, based on java project +- [x] Dependencies are moved to gradle and versions are updated +- [x] Create uberJAR with all dependencies +- [ ] Some dependencies left in imports folder. Find them and include into gradle +- [ ] Move images into resources of project +- [ ] Add tests to project. This would guarantee that after refactoring part of functionality is not broken +- [ ] Create modular OOP system (radio-module, gui, web-ui, etc). This would allow to use RADIO modules to call from CLI, GUI or Web UI. And use SDRTrunk as dependency for other projects. \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 00000000..8d07e90c --- /dev/null +++ b/build.gradle @@ -0,0 +1,73 @@ +buildscript { + repositories { + jcenter() + mavenCentral() + } + dependencies { + } +} + +apply plugin: 'java' +apply plugin: 'idea' + +repositories { + jcenter() + mavenCentral() +} + +version = '0.3.2' +sourceCompatibility = 1.8 + +sourceSets { + main.java.srcDirs 'src/main' + test.java.srcDirs 'src/test' +} + +idea { + module { + downloadJavadoc = true + downloadSources = true + } +} + +dependencies { + testCompile 'junit:junit:4.12' + testCompile 'org.assertj:assertj-core:3.8.0' + compile fileTree(dir: 'imports', include: '*.jar') + compile 'org.apache.commons:commons-lang3:3.7' + compile 'org.apache.commons:commons-io:1.3.2' + compile 'org.slf4j:slf4j-api:1.7.25' + compile 'ch.qos.logback:logback-core:1.2.3' + compile 'ch.qos.logback:logback-classic:1.2.3' + compile 'com.miglayout:miglayout-swing:5.0' + + compile 'org.usb4java:usb4java-javax:1.2.0' + compile 'org.usb4java:usb4java:1.2.0' + compile 'org.usb4java:libusb4java:1.2.0' + compile 'javax.usb:usb-api:1.0.2' + compile 'com.github.wendykierp:JTransforms:3.1' + compile 'pl.edu.icm:JLargeArrays:1.6' + compile 'net.coderazzi:tablefilter-swing:5.3.1' + compile 'com.jidesoft:jide-oss:3.4.3' + compile 'org.apache.mina:mina-core:2.0.16' + compile 'org.apache.mina:mina-http:2.0.16' + compile 'org.apache.axis:axis-jaxrpc:1.4' + compile 'org.apache.axis:axis:1.4' + compile 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.9.3' +} + +task wrapper(type: Wrapper) { + gradleVersion = '4.3.1' +} + +task buildSdr(type: Jar) { + manifest { + attributes 'Implementation-Title': 'SdrTrunk project', + 'Implementation-Version': version, + 'Main-Class': 'io.github.dsheirer.gui.SDRTrunk', + 'Class-Path': 'jmbe-0.3.2.jar jmbe-0.3.3.jar' + } + baseName = project.name + '-all' + from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } + with jar +} diff --git a/build/build.xml b/build/build.xml deleted file mode 100644 index e9f50f4c..00000000 --- a/build/build.xml +++ /dev/null @@ -1,142 +0,0 @@ - - - Ant build script for SDRTrunk Decoder Application - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000..6b6ea3ab Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..34c937c9 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionUrl=https\://services.gradle.org/distributions/gradle-4.3.1-bin.zip +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStorePath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew new file mode 100755 index 00000000..cccdd3d5 --- /dev/null +++ b/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 00000000..e95643d6 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/images/.directory b/images/.directory deleted file mode 100644 index 4d114620..00000000 --- a/images/.directory +++ /dev/null @@ -1,4 +0,0 @@ -[Dolphin] -PreviewsShown=true -Timestamp=2013,9,20,8,54,21 -Version=3 diff --git a/imports/.directory b/imports/.directory deleted file mode 100644 index 2154816a..00000000 --- a/imports/.directory +++ /dev/null @@ -1,4 +0,0 @@ -[Dolphin] -Timestamp=2013,4,7,10,12,39 -Version=3 -ViewMode=1 diff --git a/imports/JLargeArrays-1.2.jar b/imports/JLargeArrays-1.2.jar deleted file mode 100644 index 7be7a5da..00000000 Binary files a/imports/JLargeArrays-1.2.jar and /dev/null differ diff --git a/imports/JTransforms-3.0.jar b/imports/JTransforms-3.0.jar deleted file mode 100644 index 9cc2e3f3..00000000 Binary files a/imports/JTransforms-3.0.jar and /dev/null differ diff --git a/imports/activation-1.1.jar b/imports/activation-1.1.jar deleted file mode 100644 index 53f82a1c..00000000 Binary files a/imports/activation-1.1.jar and /dev/null differ diff --git a/imports/axis.jar b/imports/axis.jar deleted file mode 100644 index 20b09a59..00000000 Binary files a/imports/axis.jar and /dev/null differ diff --git a/imports/commons-codec-1.9.jar b/imports/commons-codec-1.9.jar deleted file mode 100644 index ef35f1c5..00000000 Binary files a/imports/commons-codec-1.9.jar and /dev/null differ diff --git a/imports/commons-discovery-0.2.jar b/imports/commons-discovery-0.2.jar deleted file mode 100644 index b8855484..00000000 Binary files a/imports/commons-discovery-0.2.jar and /dev/null differ diff --git a/imports/commons-io-2.4.jar b/imports/commons-io-2.4.jar deleted file mode 100644 index 90035a4f..00000000 Binary files a/imports/commons-io-2.4.jar and /dev/null differ diff --git a/imports/commons-lang3-3.2.1.jar b/imports/commons-lang3-3.2.1.jar deleted file mode 100644 index 6bf4f93c..00000000 Binary files a/imports/commons-lang3-3.2.1.jar and /dev/null differ diff --git a/imports/commons-logging-1.2.jar b/imports/commons-logging-1.2.jar deleted file mode 100644 index 93a3b9f6..00000000 Binary files a/imports/commons-logging-1.2.jar and /dev/null differ diff --git a/imports/java-mail-1.4.jar b/imports/java-mail-1.4.jar deleted file mode 100644 index e6f70832..00000000 Binary files a/imports/java-mail-1.4.jar and /dev/null differ diff --git a/imports/javassist-3.20.0-GA.jar b/imports/javassist-3.20.0-GA.jar deleted file mode 100644 index 0f1ff725..00000000 Binary files a/imports/javassist-3.20.0-GA.jar and /dev/null differ diff --git a/imports/jaxrpc.jar b/imports/jaxrpc.jar deleted file mode 100644 index a2c13d9a..00000000 Binary files a/imports/jaxrpc.jar and /dev/null differ diff --git a/imports/jide-oss-3.5.15.jar b/imports/jide-oss-3.5.15.jar deleted file mode 100644 index 18b5acfa..00000000 Binary files a/imports/jide-oss-3.5.15.jar and /dev/null differ diff --git a/imports/jsr80-1.0.1.jar b/imports/jsr80-1.0.1.jar deleted file mode 100644 index ead7cbef..00000000 Binary files a/imports/jsr80-1.0.1.jar and /dev/null differ diff --git a/imports/libusb4java-1.2.0-linux-aarch64.jar b/imports/libusb4java-1.2.0-linux-aarch64.jar deleted file mode 100644 index 61a2e742..00000000 Binary files a/imports/libusb4java-1.2.0-linux-aarch64.jar and /dev/null differ diff --git a/imports/libusb4java-1.2.0-linux-arm.jar b/imports/libusb4java-1.2.0-linux-arm.jar deleted file mode 100644 index cb29774c..00000000 Binary files a/imports/libusb4java-1.2.0-linux-arm.jar and /dev/null differ diff --git a/imports/libusb4java-1.2.0-linux-ppc.jar b/imports/libusb4java-1.2.0-linux-ppc.jar deleted file mode 100644 index f094b27d..00000000 Binary files a/imports/libusb4java-1.2.0-linux-ppc.jar and /dev/null differ diff --git a/imports/libusb4java-1.2.0-linux-x86.jar b/imports/libusb4java-1.2.0-linux-x86.jar deleted file mode 100644 index 16ac5385..00000000 Binary files a/imports/libusb4java-1.2.0-linux-x86.jar and /dev/null differ diff --git a/imports/libusb4java-1.2.0-linux-x86_64.jar b/imports/libusb4java-1.2.0-linux-x86_64.jar deleted file mode 100644 index 4652525e..00000000 Binary files a/imports/libusb4java-1.2.0-linux-x86_64.jar and /dev/null differ diff --git a/imports/libusb4java-1.2.0-osx-x86.jar b/imports/libusb4java-1.2.0-osx-x86.jar deleted file mode 100644 index d4168ca5..00000000 Binary files a/imports/libusb4java-1.2.0-osx-x86.jar and /dev/null differ diff --git a/imports/libusb4java-1.2.0-osx-x86_64.jar b/imports/libusb4java-1.2.0-osx-x86_64.jar deleted file mode 100644 index c2d4e2c5..00000000 Binary files a/imports/libusb4java-1.2.0-osx-x86_64.jar and /dev/null differ diff --git a/imports/libusb4java-1.2.0-windows-x86.jar b/imports/libusb4java-1.2.0-windows-x86.jar deleted file mode 100644 index 58461996..00000000 Binary files a/imports/libusb4java-1.2.0-windows-x86.jar and /dev/null differ diff --git a/imports/libusb4java-1.2.0-windows-x86_64.jar b/imports/libusb4java-1.2.0-windows-x86_64.jar deleted file mode 100644 index 56b9d657..00000000 Binary files a/imports/libusb4java-1.2.0-windows-x86_64.jar and /dev/null differ diff --git a/imports/logback-classic-1.1.2.jar b/imports/logback-classic-1.1.2.jar deleted file mode 100644 index 3d5d0fff..00000000 Binary files a/imports/logback-classic-1.1.2.jar and /dev/null differ diff --git a/imports/logback-core-1.1.2.jar b/imports/logback-core-1.1.2.jar deleted file mode 100644 index 575aec5e..00000000 Binary files a/imports/logback-core-1.1.2.jar and /dev/null differ diff --git a/imports/miglayout-4.0-swing.jar b/imports/miglayout-4.0-swing.jar deleted file mode 100644 index 7b6a22ca..00000000 Binary files a/imports/miglayout-4.0-swing.jar and /dev/null differ diff --git a/imports/mina-core-2.0.16.jar b/imports/mina-core-2.0.16.jar deleted file mode 100644 index 0e6d9883..00000000 Binary files a/imports/mina-core-2.0.16.jar and /dev/null differ diff --git a/imports/mina-http-2.0.16.jar b/imports/mina-http-2.0.16.jar deleted file mode 100644 index 62a5efcc..00000000 Binary files a/imports/mina-http-2.0.16.jar and /dev/null differ diff --git a/imports/slf4j-api-1.7.21.jar b/imports/slf4j-api-1.7.21.jar deleted file mode 100644 index 2a5c33ec..00000000 Binary files a/imports/slf4j-api-1.7.21.jar and /dev/null differ diff --git a/imports/tablefilter-swing-5.2.1.jar b/imports/tablefilter-swing-5.2.1.jar deleted file mode 100644 index a7d26029..00000000 Binary files a/imports/tablefilter-swing-5.2.1.jar and /dev/null differ diff --git a/imports/usb-api-1.0.2.jar b/imports/usb-api-1.0.2.jar deleted file mode 100644 index 7abd6f70..00000000 Binary files a/imports/usb-api-1.0.2.jar and /dev/null differ diff --git a/imports/usb4java-1.2.0.jar b/imports/usb4java-1.2.0.jar deleted file mode 100644 index fa6128d7..00000000 Binary files a/imports/usb4java-1.2.0.jar and /dev/null differ diff --git a/imports/usb4java-javax-1.2.0.jar b/imports/usb4java-javax-1.2.0.jar deleted file mode 100644 index 9c2ba2a5..00000000 Binary files a/imports/usb4java-javax-1.2.0.jar and /dev/null differ diff --git a/scripts/run_sdrtrunk_linux.sh b/scripts/run_sdrtrunk_linux.sh deleted file mode 100755 index b0d2ff65..00000000 --- a/scripts/run_sdrtrunk_linux.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -java -version - -# Test for java version 9 -JAVA_9=$(java -version 2>&1 | grep -i version | sed 's/.* "\([9]\).*/\1/') - -if [ -z ${JAVA_9+x} ]; then - echo Using Java 9 program options - # Java 9 uses the G1 garbage collector by default and requires that we specify the - # java.xml.bind package since it's been removed from the java se core library - java -cp "*:libs/*" --add-modules java.xml.bind gui.SDRTrunk; -else - echo Using Java 8 program options - java -XX:+UseG1GC -cp "*:libs/*" gui.SDRTrunk; -fi diff --git a/scripts/run_sdrtrunk_windows.bat b/scripts/run_sdrtrunk_windows.bat deleted file mode 100644 index 1c38bd44..00000000 --- a/scripts/run_sdrtrunk_windows.bat +++ /dev/null @@ -1,25 +0,0 @@ -@echo off - -java -version - -SETLOCAL ENABLEDELAYEDEXPANSION - -for /f "usebackq tokens=3" %%a in (`java -version 2^>^&1 ^| find "version"`) do ( - rem set b to the unquoted version string parsed from the java version command - set b=%%~a - - rem set c to the first character of the unquoted version string - set c=!b:~0,1! - - if !c! equ 9 ( - echo Using Java 9 options - java -cp "SDRTrunk.jar;*;libs/*;config/*;images/*" --add-modules java.xml.bind gui.SDRTrunk - ) else ( - echo Using Java 8 options - java -XX:+UseG1GC -cp "SDRTrunk.jar;*;libs/*;config/*;images/*" gui.SDRTrunk - ) -) - -ENDLOCAL - -@echo on diff --git a/sdrtrunk.iml b/sdrtrunk.iml deleted file mode 100644 index 04cc0636..00000000 --- a/sdrtrunk.iml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 00000000..e592e50e --- /dev/null +++ b/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'sdr-trunk' \ No newline at end of file diff --git a/src/.directory b/src/.directory deleted file mode 100644 index a931c4fe..00000000 --- a/src/.directory +++ /dev/null @@ -1,4 +0,0 @@ -[Dolphin] -Timestamp=2015,9,1,6,42,59 -Version=3 -ViewMode=1 diff --git a/src/alias/Alias.java b/src/alias/Alias.java deleted file mode 100644 index 8f8b5ba5..00000000 --- a/src/alias/Alias.java +++ /dev/null @@ -1,354 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package alias; - -import java.awt.Color; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import java.util.TreeSet; - -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 alias.action.AliasAction; -import alias.id.AliasID; -import alias.id.AliasIDType; -import alias.id.broadcast.BroadcastChannel; -import alias.id.nonrecordable.NonRecordable; -import alias.id.priority.Priority; - -@XmlSeeAlso( { AliasID.class, AliasAction.class } ) -@XmlRootElement( name = "alias" ) -public class Alias -{ - private String mList; - private String mGroup; - private String mName; - private int mColor; - private String mIconName; - private List mAliasIDs = new ArrayList(); - private List mAliasActions = new ArrayList(); - - public Alias() - { - } - - public Alias( String name ) - { - mName = name; - } - - public String toString() - { - return getName(); - } - - @XmlAttribute( name="name" ) - public String getName() - { - return mName; - } - - public void setName( 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; - } - - @XmlAttribute( name="group" ) - public String getGroup() - { - return mGroup; - } - - public void setGroup( String group ) - { - mGroup = group; - } - - public boolean hasGroup() - { - return mGroup != null; - } - - @XmlAttribute - public int getColor() - { - return mColor; - } - - public void setColor( int color ) - { - mColor = color; - } - - 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 getId() - { - return mAliasIDs; - } - - public void setId( ArrayList id ) - { - mAliasIDs = id; - } - - public void addAliasID( AliasID id ) - { - mAliasIDs.add( id ); - } - - public void removeAliasID( AliasID id ) - { - mAliasIDs.remove( id ); - } - - @XmlElement( name="action" ) - public List getAction() - { - return mAliasActions; - } - - public void setAction( List 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(); - } - - /** - * 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; - } - } - - return false; - } - - /** - * 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 ); - } - } - - /** - * 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; - } - - /** - * 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() ); - } - } - - /** - * Inspects the alias for broadcast channel/streamable alias ids. Default is false; - */ - @XmlTransient - 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. - */ - @XmlTransient - public Set getBroadcastChannels() - { - Set 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; - } -} diff --git a/src/alias/action/AliasAction.java b/src/alias/action/AliasAction.java deleted file mode 100644 index c353da28..00000000 --- a/src/alias/action/AliasAction.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * 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 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 - * - ******************************************************************************/ -package alias.action; - -import alias.Alias; -import alias.action.beep.BeepAction; -import alias.action.clip.ClipAction; -import alias.action.script.ScriptAction; -import message.Message; - -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" ) -public abstract class 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 ); - - /** - * Dismiss a persistent alias action - */ - public abstract void dismiss( boolean reset ); -} diff --git a/src/alias/action/beep/BeepAction.java b/src/alias/action/beep/BeepAction.java deleted file mode 100644 index 65ebd2bd..00000000 --- a/src/alias/action/beep/BeepAction.java +++ /dev/null @@ -1,28 +0,0 @@ -package alias.action.beep; - -import message.Message; -import alias.Alias; -import alias.action.AliasActionType; -import alias.action.RecurringAction; - -public class BeepAction extends RecurringAction -{ - - @Override - public AliasActionType getType() - { - return AliasActionType.BEEP; - } - - @Override - public void performAction( Alias alias, Message message ) - { - System.out.println( "\007" ); - } - - @Override - public String toString() - { - return "Beep"; - } -} diff --git a/src/alias/action/clip/ClipAction.java b/src/alias/action/clip/ClipAction.java deleted file mode 100644 index dd338d96..00000000 --- a/src/alias/action/clip/ClipAction.java +++ /dev/null @@ -1,110 +0,0 @@ -package alias.action.clip; - -import java.io.File; - -import javax.sound.sampled.AudioInputStream; -import javax.sound.sampled.AudioSystem; -import javax.sound.sampled.Clip; -import javax.xml.bind.annotation.XmlTransient; - -import message.Message; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import alias.Alias; -import alias.action.AliasActionType; -import alias.action.RecurringAction; - -public class ClipAction extends RecurringAction -{ - private final static Logger mLog = LoggerFactory.getLogger( ClipAction.class ); - - private String mFilePath; - - @XmlTransient - private Clip mClip; - - public ClipAction() - { - } - - @Override - public AliasActionType getType() - { - return AliasActionType.CLIP; - } - - 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 ); - } - - 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; - } - } -} diff --git a/src/alias/action/script/ScriptAction.java b/src/alias/action/script/ScriptAction.java deleted file mode 100644 index 8dcfb55f..00000000 --- a/src/alias/action/script/ScriptAction.java +++ /dev/null @@ -1,98 +0,0 @@ -package alias.action.script; - -import java.io.BufferedReader; -import java.io.InputStreamReader; - -import message.Message; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import alias.Alias; -import alias.action.AliasActionType; -import alias.action.RecurringAction; - -public class ScriptAction extends RecurringAction -{ - private final static Logger mLog = LoggerFactory.getLogger( ScriptAction.class ); - - private String mScript; - - public ScriptAction() - { - } - - @Override - public AliasActionType getType() - { - return AliasActionType.SCRIPT; - } - - 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 ); - - 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 ) - { - sb.append(line + "\n"); - } - - if( exitCode != 0 ) - { - throw new RuntimeException( "Exit Code: " + exitCode + - " Console:" + sb.toString() ); - } - } - } - - @Override - public String toString() - { - if( mScript == null ) - { - return "Run Script"; - } - else - { - return "Run Script: " + mScript; - } - } -} diff --git a/src/alias/id/AliasID.java b/src/alias/id/AliasID.java deleted file mode 100644 index 25eff7d5..00000000 --- a/src/alias/id/AliasID.java +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package alias.id; - -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlTransient; - -import alias.id.broadcast.BroadcastChannel; -import playlist.version1.Group; -import alias.id.esn.Esn; -import alias.id.fleetsync.FleetsyncID; -import alias.id.lojack.LoJackFunctionAndID; -import alias.id.mdc.MDC1200ID; -import alias.id.mobileID.Min; -import alias.id.mpt1327.MPT1327ID; -import alias.id.nonrecordable.NonRecordable; -import alias.id.priority.Priority; -import alias.id.siteID.SiteID; -import alias.id.status.StatusID; -import alias.id.talkgroup.TalkgroupID; -import alias.id.uniqueID.UniqueID; - -@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" ) -public abstract class AliasID -{ - public AliasID() - { - } - - public abstract AliasIDType getType(); - - public abstract boolean matches( AliasID id ); - - @XmlTransient - public abstract boolean isValid(); -} diff --git a/src/alias/id/lojack/LoJackFunctionAndID.java b/src/alias/id/lojack/LoJackFunctionAndID.java deleted file mode 100644 index f2cc8c80..00000000 --- a/src/alias/id/lojack/LoJackFunctionAndID.java +++ /dev/null @@ -1,138 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package alias.id.lojack; - -import javax.xml.bind.annotation.XmlAttribute; - -import module.decode.lj1200.LJ1200Message; -import module.decode.lj1200.LJ1200Message.Function; -import alias.id.AliasID; -import alias.id.AliasIDType; - -public class LoJackFunctionAndID extends AliasID -{ - private LJ1200Message.Function mFunction = Function.F0_UNKNOWN; - private String mID = "*****"; - - public LoJackFunctionAndID() - { - } - - @XmlAttribute( name="id" ) - public String getID() - { - return mID; - } - - public void setID( String id ) - { - mID = id; - } - - @XmlAttribute( name="function" ) - public Function getFunction() - { - return mFunction; - } - - public void setFunction( 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( 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; - } - - @Override - public AliasIDType getType() - { - 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; - } -} diff --git a/src/alias/id/mdc/MDC1200ID.java b/src/alias/id/mdc/MDC1200ID.java deleted file mode 100644 index 731b1153..00000000 --- a/src/alias/id/mdc/MDC1200ID.java +++ /dev/null @@ -1,79 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package alias.id.mdc; - -import javax.xml.bind.annotation.XmlAttribute; - -import alias.id.AliasID; -import alias.id.AliasIDType; - - -public class MDC1200ID extends AliasID -{ - private String mID; - - public MDC1200ID() - { - } - - @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 ) - { - 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 - public AliasIDType getType() - { - return AliasIDType.MDC1200; - } -} diff --git a/src/alias/id/mobileID/Min.java b/src/alias/id/mobileID/Min.java deleted file mode 100644 index bba33fdd..00000000 --- a/src/alias/id/mobileID/Min.java +++ /dev/null @@ -1,81 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package alias.id.mobileID; - -import javax.xml.bind.annotation.XmlAttribute; - -import alias.id.AliasID; -import alias.id.AliasIDType; - -/** - * Mobile ID Number - */ -public class Min extends AliasID -{ - private String mMin; - - public Min() - { - } - - @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 ) - { - 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 - public AliasIDType getType() - { - return AliasIDType.MIN; - } -} diff --git a/src/alias/id/mpt1327/MPT1327ID.java b/src/alias/id/mpt1327/MPT1327ID.java deleted file mode 100644 index 12b45d52..00000000 --- a/src/alias/id/mpt1327/MPT1327ID.java +++ /dev/null @@ -1,78 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package alias.id.mpt1327; - -import javax.xml.bind.annotation.XmlAttribute; - -import alias.id.AliasID; -import alias.id.AliasIDType; - -public class MPT1327ID extends AliasID -{ - private String mID; - - public MPT1327ID() - { - } - - @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 ) - { - 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 - public AliasIDType getType() - { - return AliasIDType.MPT1327; - } -} diff --git a/src/alias/id/nonrecordable/NonRecordable.java b/src/alias/id/nonrecordable/NonRecordable.java deleted file mode 100644 index c881c360..00000000 --- a/src/alias/id/nonrecordable/NonRecordable.java +++ /dev/null @@ -1,31 +0,0 @@ -package alias.id.nonrecordable; - -import alias.id.AliasID; -import alias.id.AliasIDType; - -public class NonRecordable extends AliasID -{ - @Override - public AliasIDType getType() - { - return AliasIDType.NON_RECORDABLE; - } - - @Override - public boolean isValid() - { - return true; - } - - @Override - public boolean matches( AliasID id ) - { - return false; - } - - @Override - public String toString() - { - return "Audio Non-Recordable"; - } -} diff --git a/src/alias/id/priority/Priority.java b/src/alias/id/priority/Priority.java deleted file mode 100644 index 9243db45..00000000 --- a/src/alias/id/priority/Priority.java +++ /dev/null @@ -1,83 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package alias.id.priority; - -import javax.xml.bind.annotation.XmlAttribute; - -import alias.id.AliasID; -import alias.id.AliasIDType; - -/** - * 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() - { - } - - @Override - public boolean isValid() - { - return true; - } - - /** - * 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 ) - { - return false; - } - - @Override - public AliasIDType getType() - { - return AliasIDType.PRIORITY; - } -} diff --git a/src/alias/id/siteID/SiteID.java b/src/alias/id/siteID/SiteID.java deleted file mode 100644 index a16008e1..00000000 --- a/src/alias/id/siteID/SiteID.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package alias.id.siteID; - -import javax.xml.bind.annotation.XmlAttribute; - -import alias.id.AliasID; -import alias.id.AliasIDType; - -public class SiteID extends AliasID -{ - private String mSite; - - public SiteID() - { - } - - @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 ) - { - return otherID != null && - otherID instanceof SiteID && - getSite().contentEquals( ( (SiteID)otherID).getSite() ); - } - - @Override - public AliasIDType getType() - { - return AliasIDType.SITE; - } -} diff --git a/src/alias/id/status/StatusID.java b/src/alias/id/status/StatusID.java deleted file mode 100644 index 71ccb5d8..00000000 --- a/src/alias/id/status/StatusID.java +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package alias.id.status; - -import javax.xml.bind.annotation.XmlAttribute; - -import alias.id.AliasID; -import alias.id.AliasIDType; - -public class StatusID extends AliasID -{ - private int mStatus; - - public StatusID() - { - } - - @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 ) - { - boolean retVal = false; - - if( id instanceof StatusID ) - { - StatusID statusId = (StatusID)id; - - retVal = ( mStatus == statusId.getStatus() ); - } - - return retVal; - } - - @Override - public AliasIDType getType() - { - return AliasIDType.STATUS; - } -} diff --git a/src/alias/id/uniqueID/UniqueID.java b/src/alias/id/uniqueID/UniqueID.java deleted file mode 100644 index 69302b38..00000000 --- a/src/alias/id/uniqueID/UniqueID.java +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package alias.id.uniqueID; - -import javax.xml.bind.annotation.XmlAttribute; - -import alias.id.AliasID; -import alias.id.AliasIDType; - -public class UniqueID extends AliasID -{ - private int mUid; - - public UniqueID() - { - } - - @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 ) - { - boolean retVal = false; - - if( id instanceof UniqueID ) - { - UniqueID uid = (UniqueID)id; - - retVal = mUid == uid.getUid(); - } - - return retVal; - } - - @Override - public AliasIDType getType() - { - return AliasIDType.LTR_NET_UID; - } -} diff --git a/src/controller/channel/map/ChannelMap.java b/src/controller/channel/map/ChannelMap.java deleted file mode 100644 index 107280f8..00000000 --- a/src/controller/channel/map/ChannelMap.java +++ /dev/null @@ -1,145 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package controller.channel.map; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlTransient; - -@XmlSeeAlso( { ChannelRange.class } ) -public class ChannelMap -{ - private String mName; - private boolean mInvalid = false; - - private List mRanges = new ArrayList(); - - 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; - } - - @XmlTransient - public boolean isInvalid() - { - return mInvalid; - } - - public String toString() - { - return mName + ( mInvalid ? " - Error" : "" ); - } - - @XmlElement( name = "range" ) - public List getRanges() - { - return mRanges; - } - - public void setRanges( List 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; - } - - /** - * 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(); - } - -} diff --git a/src/controller/channel/map/ChannelRange.java b/src/controller/channel/map/ChannelRange.java deleted file mode 100644 index 5e086b89..00000000 --- a/src/controller/channel/map/ChannelRange.java +++ /dev/null @@ -1,186 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package controller.channel.map; - -import java.text.DecimalFormat; - -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlTransient; -import javax.xml.bind.annotation.XmlType; - -@XmlRootElement -@XmlType( name = "range" ) -public class ChannelRange -{ - 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; - - public ChannelRange() - { - } - - public ChannelRange( int first, int last, int base, int size ) - { - mFirst = first; - mLast = last; - mBase = base; - mSize = size; - } - - 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!" ); - } - - 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 ); - } - - @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; - } - - @XmlAttribute( name = "last" ) - public void setLastChannelNumber( int last ) - { - mLast = last; - } - - public int getLastChannelNumber() - { - return mLast; - } - - /** - * Sets the base frequency - * @param base frequency in hertz - */ - @XmlAttribute( name = "base" ) - public void setBase( int base ) - { - mBase = base; - } - - public int getBase() - { - return mBase; - } - - /** - * Sets the channel size - * @param size in hertz - */ - @XmlAttribute( name = "size" ) - public void setSize( int size ) - { - mSize = size; - } - - public int getSize() - { - return mSize; - } -} diff --git a/src/controller/config/Configuration.java b/src/controller/config/Configuration.java deleted file mode 100644 index 53bc1929..00000000 --- a/src/controller/config/Configuration.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package controller.config; - -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; - -import module.decode.config.AuxDecodeConfiguration; -import module.decode.config.DecodeConfiguration; -import module.log.config.EventLogConfiguration; -import record.config.RecordConfiguration; -import source.config.SourceConfiguration; - -@XmlSeeAlso( { AuxDecodeConfiguration.class, - DecodeConfiguration.class, - EventLogConfiguration.class, - RecordConfiguration.class, - SourceConfiguration.class } ) -@XmlRootElement( name = "configuration" ) -public abstract class Configuration -{ - public Configuration() - { - } -} diff --git a/src/main/java/io/github/dsheirer/alias/Alias.java b/src/main/java/io/github/dsheirer/alias/Alias.java new file mode 100644 index 00000000..588995cd --- /dev/null +++ b/src/main/java/io/github/dsheirer/alias/Alias.java @@ -0,0 +1,351 @@ +/******************************************************************************* + * 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 + ******************************************************************************/ +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; +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 java.awt.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +@JacksonXmlRootElement(localName = "alias") +public class Alias +{ + private String mList; + private String mGroup; + private String mName; + private int mColor; + private String mIconName; + private List mAliasIDs = new ArrayList(); + private List mAliasActions = new ArrayList(); + + public Alias() + { + } + + public Alias(String name) + { + mName = name; + } + + public String toString() + { + return getName(); + } + + @JacksonXmlProperty(isAttribute = true, localName = "name") + public String getName() + { + return mName; + } + + public void setName(String name) + { + mName = name; + } + + @JacksonXmlProperty(isAttribute = true, localName = "list") + public String getList() + { + return mList; + } + + public void setList(String list) + { + mList = list; + } + + public boolean hasList() + { + return mList != null; + } + + @JacksonXmlProperty(isAttribute = true, localName = "group") + public String getGroup() + { + return mGroup; + } + + public void setGroup(String group) + { + mGroup = group; + } + + public boolean hasGroup() + { + return mGroup != null; + } + + @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 getId() + { + return mAliasIDs; + } + + public void setId(ArrayList 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 getAction() + { + return mAliasActions; + } + + public void setAction(List 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(); + } + + /** + * Perform any validation/cleanup actions on this alias. + */ + public void validate() + { + } + + /** + * 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.PRIORITY) + { + return ((Priority)id).getPriority(); + } + } + + return Priority.DEFAULT_PRIORITY; + } + + public boolean hasCallPriority() + { + for(AliasID id : mAliasIDs) + { + if(id.getType() == AliasIDType.PRIORITY) + { + return true; + } + } + + return false; + } + + /** + * 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); + } + } + + /** + * 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; + } + } + + return true; + } + + /** + * 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()); + } + } + + /** + * 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 getBroadcastChannels() + { + Set 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; + } +} diff --git a/src/alias/AliasController.java b/src/main/java/io/github/dsheirer/alias/AliasController.java similarity index 98% rename from src/alias/AliasController.java rename to src/main/java/io/github/dsheirer/alias/AliasController.java index 7dc27ccf..48f6935c 100644 --- a/src/alias/AliasController.java +++ b/src/main/java/io/github/dsheirer/alias/AliasController.java @@ -1,9 +1,9 @@ -package alias; +package io.github.dsheirer.alias; -import audio.broadcast.BroadcastModel; import com.jidesoft.swing.JideSplitPane; -import gui.editor.Editor; -import icon.IconManager; +import io.github.dsheirer.audio.broadcast.BroadcastModel; +import io.github.dsheirer.gui.editor.Editor; +import io.github.dsheirer.icon.IconManager; import net.coderazzi.filters.gui.AutoChoices; import net.coderazzi.filters.gui.TableFilterHeader; import net.miginfocom.swing.MigLayout; diff --git a/src/alias/AliasEditor.java b/src/main/java/io/github/dsheirer/alias/AliasEditor.java similarity index 91% rename from src/alias/AliasEditor.java rename to src/main/java/io/github/dsheirer/alias/AliasEditor.java index 706ef5e4..a6df0774 100644 --- a/src/alias/AliasEditor.java +++ b/src/main/java/io/github/dsheirer/alias/AliasEditor.java @@ -15,27 +15,21 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias; - -import audio.broadcast.BroadcastModel; -import gui.editor.Editor; - -import java.awt.Color; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.JButton; -import javax.swing.JLabel; -import javax.swing.JSeparator; - -import icon.IconManager; -import net.miginfocom.swing.MigLayout; -import sample.Listener; -import settings.SettingsManager; -import alias.action.AliasActionEditor; -import alias.id.AliasIdentifierEditor; +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 javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; public class AliasEditor extends Editor implements ActionListener, Listener diff --git a/src/alias/AliasEvent.java b/src/main/java/io/github/dsheirer/alias/AliasEvent.java similarity index 97% rename from src/alias/AliasEvent.java rename to src/main/java/io/github/dsheirer/alias/AliasEvent.java index c1cacd74..f0370ae6 100644 --- a/src/alias/AliasEvent.java +++ b/src/main/java/io/github/dsheirer/alias/AliasEvent.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias; +package io.github.dsheirer.alias; public class AliasEvent { diff --git a/src/alias/AliasFactory.java b/src/main/java/io/github/dsheirer/alias/AliasFactory.java similarity index 76% rename from src/alias/AliasFactory.java rename to src/main/java/io/github/dsheirer/alias/AliasFactory.java index 7acb920e..ad28d053 100644 --- a/src/alias/AliasFactory.java +++ b/src/main/java/io/github/dsheirer/alias/AliasFactory.java @@ -15,47 +15,47 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias; +package io.github.dsheirer.alias; -import alias.action.AliasAction; -import alias.action.AliasActionType; -import alias.action.beep.BeepAction; -import alias.action.beep.BeepActionEditor; -import alias.action.clip.ClipAction; -import alias.action.clip.ClipActionEditor; -import alias.action.script.ScriptAction; -import alias.action.script.ScriptActionEditor; -import alias.id.AliasID; -import alias.id.AliasIDType; -import alias.id.broadcast.BroadcastChannel; -import alias.id.broadcast.BroadcastChannelEditor; -import alias.id.esn.ESNEditor; -import alias.id.esn.Esn; -import alias.id.fleetsync.FleetsyncID; -import alias.id.fleetsync.FleetsyncIDEditor; -import alias.id.lojack.LoJackFunctionAndID; -import alias.id.lojack.LoJackIDEditor; -import alias.id.mdc.MDC1200ID; -import alias.id.mdc.MDC1200IDEditor; -import alias.id.mobileID.MINEditor; -import alias.id.mobileID.Min; -import alias.id.mpt1327.MPT1327ID; -import alias.id.mpt1327.MPT1327IDEditor; -import alias.id.nonrecordable.NonRecordable; -import alias.id.nonrecordable.NonRecordableEditor; -import alias.id.priority.Priority; -import alias.id.priority.PriorityEditor; -import alias.id.siteID.SiteID; -import alias.id.siteID.SiteIDEditor; -import alias.id.status.StatusID; -import alias.id.status.StatusIDEditor; -import alias.id.talkgroup.TalkgroupID; -import alias.id.talkgroup.TalkgroupIDEditor; -import alias.id.uniqueID.UniqueID; -import alias.id.uniqueID.UniqueIDEditor; -import audio.broadcast.BroadcastModel; -import gui.editor.Editor; -import 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; +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 { @@ -138,7 +138,7 @@ public class AliasFactory { return new BeepAction(); } - else if( action instanceof ClipAction ) + else if( action instanceof ClipAction) { ClipAction originalClip = (ClipAction)action; ClipAction copyClip = new ClipAction(); diff --git a/src/alias/AliasList.java b/src/main/java/io/github/dsheirer/alias/AliasList.java similarity index 95% rename from src/alias/AliasList.java rename to src/main/java/io/github/dsheirer/alias/AliasList.java index 44a2b2e9..b51503bf 100644 --- a/src/alias/AliasList.java +++ b/src/main/java/io/github/dsheirer/alias/AliasList.java @@ -16,26 +16,26 @@ * along with this program. If not, see * ******************************************************************************/ -package alias; +package io.github.dsheirer.alias; -import alias.id.AliasID; -import alias.id.WildcardID; -import alias.id.esn.Esn; -import alias.id.fleetsync.FleetsyncID; -import alias.id.lojack.LoJackFunctionAndID; -import alias.id.mdc.MDC1200ID; -import alias.id.mobileID.Min; -import alias.id.mpt1327.MPT1327ID; -import alias.id.siteID.SiteID; -import alias.id.status.StatusID; -import alias.id.talkgroup.TalkgroupID; -import alias.id.uniqueID.UniqueID; -import module.decode.lj1200.LJ1200Message.Function; +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; +import io.github.dsheirer.alias.id.fleetsync.FleetsyncID; +import io.github.dsheirer.alias.id.lojack.LoJackFunctionAndID; +import io.github.dsheirer.alias.id.mdc.MDC1200ID; +import io.github.dsheirer.alias.id.mobileID.Min; +import io.github.dsheirer.alias.id.mpt1327.MPT1327ID; +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.module.decode.lj1200.LJ1200Message; +import io.github.dsheirer.sample.Listener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; -import javax.xml.bind.annotation.XmlAttribute; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -486,7 +486,7 @@ public class AliasList implements Listener /** * Lookup alias by lojack function and ID */ - public Alias getLoJackAlias(Function function, String id) + public Alias getLoJackAlias(LJ1200Message.Function function, String id) { if(id != null) { @@ -625,7 +625,7 @@ public class AliasList implements Listener /** * Alias list name */ - @XmlAttribute + @JacksonXmlProperty(isAttribute = true, localName = "name") public String getName() { return mName; diff --git a/src/alias/AliasModel.java b/src/main/java/io/github/dsheirer/alias/AliasModel.java similarity index 95% rename from src/alias/AliasModel.java rename to src/main/java/io/github/dsheirer/alias/AliasModel.java index 1389d299..2a62f05f 100644 --- a/src/alias/AliasModel.java +++ b/src/main/java/io/github/dsheirer/alias/AliasModel.java @@ -15,12 +15,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias; +package io.github.dsheirer.alias; -import alias.AliasEvent.Event; -import alias.id.broadcast.BroadcastChannel; -import sample.Broadcaster; -import sample.Listener; +import io.github.dsheirer.alias.id.broadcast.BroadcastChannel; +import io.github.dsheirer.sample.Broadcaster; +import io.github.dsheirer.sample.Listener; import javax.swing.table.AbstractTableModel; import java.util.ArrayList; @@ -188,7 +187,7 @@ public class AliasModel extends AbstractTableModel fireTableRowsInserted(index, index); - broadcast(new AliasEvent(alias, Event.ADD)); + broadcast(new AliasEvent(alias, AliasEvent.Event.ADD)); return index; } @@ -209,7 +208,7 @@ public class AliasModel extends AbstractTableModel fireTableRowsDeleted(index, index); - broadcast(new AliasEvent(alias, Event.DELETE)); + broadcast(new AliasEvent(alias, AliasEvent.Event.DELETE)); } } @@ -328,7 +327,7 @@ public class AliasModel extends AbstractTableModel alias.validate(); } - if(event.getEvent() == Event.CHANGE) + if(event.getEvent() == AliasEvent.Event.CHANGE) { int index = mAliases.indexOf(event.getAlias()); diff --git a/src/alias/AliasNameEditor.java b/src/main/java/io/github/dsheirer/alias/AliasNameEditor.java similarity index 96% rename from src/alias/AliasNameEditor.java rename to src/main/java/io/github/dsheirer/alias/AliasNameEditor.java index 3c205941..6fcc06aa 100644 --- a/src/alias/AliasNameEditor.java +++ b/src/main/java/io/github/dsheirer/alias/AliasNameEditor.java @@ -16,14 +16,13 @@ * along with this program. If not, see * ******************************************************************************/ -package alias; +package io.github.dsheirer.alias; -import alias.AliasEvent.Event; -import gui.editor.Editor; -import icon.Icon; -import icon.IconListCellRenderer; -import icon.IconManager; -import icon.IconTableModel; +import io.github.dsheirer.gui.editor.Editor; +import io.github.dsheirer.icon.Icon; +import io.github.dsheirer.icon.IconListCellRenderer; +import io.github.dsheirer.icon.IconManager; +import io.github.dsheirer.icon.IconTableModel; import net.miginfocom.swing.MigLayout; import javax.swing.*; @@ -328,7 +327,7 @@ public class AliasNameEditor extends Editor setModified(false); //Broadcast an alias change event to save the updates - mAliasModel.broadcast(new AliasEvent(getItem(), Event.CHANGE)); + mAliasModel.broadcast(new AliasEvent(getItem(), AliasEvent.Event.CHANGE)); } } } diff --git a/src/alias/ComponentEditor.java b/src/main/java/io/github/dsheirer/alias/ComponentEditor.java similarity index 98% rename from src/alias/ComponentEditor.java rename to src/main/java/io/github/dsheirer/alias/ComponentEditor.java index 9cc909bf..7bae5fcf 100644 --- a/src/alias/ComponentEditor.java +++ b/src/main/java/io/github/dsheirer/alias/ComponentEditor.java @@ -15,9 +15,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias; +package io.github.dsheirer.alias; -import javax.swing.JPanel; +import javax.swing.*; import javax.swing.event.DocumentListener; public abstract class ComponentEditor extends JPanel implements DocumentListener @@ -86,7 +86,7 @@ public abstract class ComponentEditor extends JPanel implements DocumentListe public abstract void save(); /** - * Reloads the editor contents from the source component and resets the + * Reloads the editor contents from the source component and resets the * modified flag */ public void reset() diff --git a/src/alias/ComponentValidationException.java b/src/main/java/io/github/dsheirer/alias/ComponentValidationException.java similarity index 88% rename from src/alias/ComponentValidationException.java rename to src/main/java/io/github/dsheirer/alias/ComponentValidationException.java index bfa8d925..9bf0445a 100644 --- a/src/alias/ComponentValidationException.java +++ b/src/main/java/io/github/dsheirer/alias/ComponentValidationException.java @@ -1,4 +1,4 @@ -package alias; +package io.github.dsheirer.alias; public class ComponentValidationException extends Exception { diff --git a/src/alias/MultipleAliasEditor.java b/src/main/java/io/github/dsheirer/alias/MultipleAliasEditor.java similarity index 95% rename from src/alias/MultipleAliasEditor.java rename to src/main/java/io/github/dsheirer/alias/MultipleAliasEditor.java index 796379b4..472911fc 100644 --- a/src/alias/MultipleAliasEditor.java +++ b/src/main/java/io/github/dsheirer/alias/MultipleAliasEditor.java @@ -1,18 +1,17 @@ -package alias; +package io.github.dsheirer.alias; -import alias.AliasEvent.Event; -import alias.id.AliasIDType; -import alias.id.broadcast.BroadcastChannel; -import alias.id.priority.Priority; -import audio.broadcast.BroadcastModel; -import gui.editor.Editor; -import icon.Icon; -import icon.IconListCellRenderer; -import icon.IconManager; +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; +import io.github.dsheirer.gui.editor.Editor; +import io.github.dsheirer.icon.Icon; +import io.github.dsheirer.icon.IconListCellRenderer; +import io.github.dsheirer.icon.IconManager; +import io.github.dsheirer.sample.Listener; import net.miginfocom.swing.MigLayout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; import javax.swing.*; import javax.swing.event.ChangeEvent; @@ -430,7 +429,7 @@ public class MultipleAliasEditor extends Editor> for (Alias alias : aliases) { //Broadcast an alias change event to save the updates - mAliasModel.broadcast(new AliasEvent(alias, Event.CHANGE)); + mAliasModel.broadcast(new AliasEvent(alias, AliasEvent.Event.CHANGE)); } } } @@ -438,7 +437,7 @@ public class MultipleAliasEditor extends Editor> @Override public void receive(AliasEvent event) { - if (event.getEvent() == Event.DELETE && + if (event.getEvent() == AliasEvent.Event.DELETE && hasItem() && getAliases().contains(event.getAlias())) { diff --git a/src/alias/PatchGroupAlias.java b/src/main/java/io/github/dsheirer/alias/PatchGroupAlias.java similarity index 96% rename from src/alias/PatchGroupAlias.java rename to src/main/java/io/github/dsheirer/alias/PatchGroupAlias.java index bb7e347a..9350fec8 100644 --- a/src/alias/PatchGroupAlias.java +++ b/src/main/java/io/github/dsheirer/alias/PatchGroupAlias.java @@ -16,18 +16,16 @@ * along with this program. If not, see * ******************************************************************************/ -package alias; +package io.github.dsheirer.alias; -import alias.action.AliasAction; -import alias.id.AliasID; -import alias.id.AliasIDType; -import alias.id.broadcast.BroadcastChannel; -import alias.id.priority.Priority; -import alias.id.talkgroup.TalkgroupID; -import gui.SDRTrunk; +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 playlist.version1.System; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/io/github/dsheirer/alias/action/AliasAction.java b/src/main/java/io/github/dsheirer/alias/action/AliasAction.java new file mode 100644 index 00000000..ae514992 --- /dev/null +++ b/src/main/java/io/github/dsheirer/alias/action/AliasAction.java @@ -0,0 +1,65 @@ +/******************************************************************************* + * 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 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 + * + ******************************************************************************/ +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 java.util.concurrent.ScheduledExecutorService; + +/** + * Alias action defines an action to execute when an alias is detected active. + */ +@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() + { + } + + @JsonIgnore + 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); + + /** + * Dismiss a persistent alias action + */ + public abstract void dismiss(boolean reset); +} diff --git a/src/alias/action/AliasActionEditor.java b/src/main/java/io/github/dsheirer/alias/action/AliasActionEditor.java similarity index 93% rename from src/alias/action/AliasActionEditor.java rename to src/main/java/io/github/dsheirer/alias/action/AliasActionEditor.java index f4d41aa9..388a5ea9 100644 --- a/src/alias/action/AliasActionEditor.java +++ b/src/main/java/io/github/dsheirer/alias/action/AliasActionEditor.java @@ -15,12 +15,21 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias.action; +package io.github.dsheirer.alias.action; -import gui.editor.Editor; -import gui.editor.EmptyEditor; +import io.github.dsheirer.alias.Alias; +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 java.awt.EventQueue; +import javax.swing.*; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; @@ -29,26 +38,6 @@ import java.util.Collections; import java.util.Comparator; import java.util.List; -import javax.swing.DefaultListModel; -import javax.swing.JButton; -import javax.swing.JList; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JPopupMenu; -import javax.swing.JScrollPane; -import javax.swing.ListModel; -import javax.swing.ListSelectionModel; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; - -import net.miginfocom.swing.MigLayout; -import alias.Alias; -import alias.AliasEvent; -import alias.AliasEvent.Event; -import alias.AliasFactory; -import alias.AliasModel; - public class AliasActionEditor extends Editor { private static final long serialVersionUID = 1L; @@ -277,7 +266,7 @@ public class AliasActionEditor extends Editor { int option = JOptionPane.showConfirmDialog( EditorContainer.this, - "Action settings have changed. Do you want to save these changes?", + "Action settings have changed. Do you want to save these changes?", "Save Changes?", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE ); diff --git a/src/alias/action/AliasActionListener.java b/src/main/java/io/github/dsheirer/alias/action/AliasActionListener.java similarity index 93% rename from src/alias/action/AliasActionListener.java rename to src/main/java/io/github/dsheirer/alias/action/AliasActionListener.java index a967e446..36e863d7 100644 --- a/src/alias/action/AliasActionListener.java +++ b/src/main/java/io/github/dsheirer/alias/action/AliasActionListener.java @@ -15,9 +15,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias.action; +package io.github.dsheirer.alias.action; -import alias.AliasEvent; +import io.github.dsheirer.alias.AliasEvent; /** * Interface for receiving alias events. Each listener will receive diff --git a/src/alias/action/AliasActionManager.java b/src/main/java/io/github/dsheirer/alias/action/AliasActionManager.java similarity index 91% rename from src/alias/action/AliasActionManager.java rename to src/main/java/io/github/dsheirer/alias/action/AliasActionManager.java index 0ba644d1..760122cb 100644 --- a/src/alias/action/AliasActionManager.java +++ b/src/main/java/io/github/dsheirer/alias/action/AliasActionManager.java @@ -16,12 +16,12 @@ * along with this program. If not, see * ******************************************************************************/ -package alias.action; +package io.github.dsheirer.alias.action; -import alias.Alias; -import message.Message; -import sample.Listener; -import util.ThreadPool; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.util.ThreadPool; import java.util.List; diff --git a/src/alias/action/AliasActionType.java b/src/main/java/io/github/dsheirer/alias/action/AliasActionType.java similarity index 96% rename from src/alias/action/AliasActionType.java rename to src/main/java/io/github/dsheirer/alias/action/AliasActionType.java index b54ddb06..eee09f23 100644 --- a/src/alias/action/AliasActionType.java +++ b/src/main/java/io/github/dsheirer/alias/action/AliasActionType.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias.action; +package io.github.dsheirer.alias.action; public enum AliasActionType { diff --git a/src/alias/action/RecurringAction.java b/src/main/java/io/github/dsheirer/alias/action/RecurringAction.java similarity index 88% rename from src/alias/action/RecurringAction.java rename to src/main/java/io/github/dsheirer/alias/action/RecurringAction.java index c8e54d62..8847eddf 100644 --- a/src/alias/action/RecurringAction.java +++ b/src/main/java/io/github/dsheirer/alias/action/RecurringAction.java @@ -1,11 +1,11 @@ -package alias.action; +package io.github.dsheirer.alias.action; -import alias.Alias; -import message.Message; +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); } } diff --git a/src/main/java/io/github/dsheirer/alias/action/beep/BeepAction.java b/src/main/java/io/github/dsheirer/alias/action/beep/BeepAction.java new file mode 100644 index 00000000..6a0717ac --- /dev/null +++ b/src/main/java/io/github/dsheirer/alias/action/beep/BeepAction.java @@ -0,0 +1,30 @@ +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; +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() + { + return AliasActionType.BEEP; + } + + @Override + public void performAction(Alias alias, Message message ) + { + System.out.println( "\007" ); + } + + @Override + public String toString() + { + return "Beep"; + } +} diff --git a/src/alias/action/beep/BeepActionEditor.java b/src/main/java/io/github/dsheirer/alias/action/beep/BeepActionEditor.java similarity index 86% rename from src/alias/action/beep/BeepActionEditor.java rename to src/main/java/io/github/dsheirer/alias/action/beep/BeepActionEditor.java index 1f47f9aa..109eea70 100644 --- a/src/alias/action/beep/BeepActionEditor.java +++ b/src/main/java/io/github/dsheirer/alias/action/beep/BeepActionEditor.java @@ -15,30 +15,22 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias.action.beep; +package io.github.dsheirer.alias.action.beep; -import gui.editor.DocumentListenerEditor; +import io.github.dsheirer.alias.action.AliasAction; +import io.github.dsheirer.alias.action.RecurringAction; +import io.github.dsheirer.gui.editor.DocumentListenerEditor; +import net.miginfocom.swing.MigLayout; -import java.awt.Color; -import java.awt.Cursor; +import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import javax.swing.JComboBox; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JSlider; -import javax.swing.SpinnerModel; -import javax.swing.SpinnerNumberModel; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - -import net.miginfocom.swing.MigLayout; -import alias.action.AliasAction; -import alias.action.RecurringAction.Interval; - public class BeepActionEditor extends DocumentListenerEditor { private static final long serialVersionUID = 1L; @@ -57,7 +49,7 @@ public class BeepActionEditor extends DocumentListenerEditor + "for 15 seconds after you click OK.
" + ""; - private JComboBox mComboInterval; + private JComboBox mComboInterval; private JSlider mPeriodSlider; private JLabel mPeriodSliderLabel; @@ -84,20 +76,20 @@ public class BeepActionEditor extends DocumentListenerEditor add( new JLabel( "Beep Interval:" ) ); - mComboInterval = new JComboBox( Interval.values() ); + mComboInterval = new JComboBox( RecurringAction.Interval.values() ); mComboInterval.setToolTipText( HELP_TEXT ); mComboInterval.addActionListener( new ActionListener() { @Override public void actionPerformed( ActionEvent e ) { - Interval selected = mComboInterval + RecurringAction.Interval selected = mComboInterval .getItemAt( mComboInterval.getSelectedIndex() ); if( selected != null ) { /* Enable/disable period spinner based on selection */ - boolean enabled = selected != Interval.ONCE; + boolean enabled = selected != RecurringAction.Interval.ONCE; mPeriodSlider.setEnabled( enabled ); mPeriodSliderLabel.setEnabled( enabled ); @@ -163,11 +155,11 @@ public class BeepActionEditor extends DocumentListenerEditor { BeepAction beep = getBeepAction(); - Interval interval = beep.getInterval(); + RecurringAction.Interval interval = beep.getInterval(); mComboInterval.setSelectedItem( interval ); - boolean enabled = interval != Interval.ONCE; + boolean enabled = interval != RecurringAction.Interval.ONCE; mPeriodSliderLabel.setEnabled( enabled ); mPeriodSlider.setEnabled( enabled ); @@ -184,7 +176,7 @@ public class BeepActionEditor extends DocumentListenerEditor { BeepAction beep = getBeepAction(); - beep.setInterval( (Interval)mComboInterval.getSelectedItem() ); + beep.setInterval( (RecurringAction.Interval)mComboInterval.getSelectedItem() ); beep.setPeriod( mPeriodSlider.getValue() ); } diff --git a/src/main/java/io/github/dsheirer/alias/action/clip/ClipAction.java b/src/main/java/io/github/dsheirer/alias/action/clip/ClipAction.java new file mode 100644 index 00000000..15807304 --- /dev/null +++ b/src/main/java/io/github/dsheirer/alias/action/clip/ClipAction.java @@ -0,0 +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 javax.sound.sampled.AudioInputStream; +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.Clip; +import java.io.File; + +public class ClipAction extends RecurringAction +{ + private final static Logger mLog = LoggerFactory.getLogger(ClipAction.class); + + private String mFilePath; + + @JsonIgnore + private Clip mClip; + + public ClipAction() + { + } + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + @Override + public AliasActionType getType() + { + return AliasActionType.CLIP; + } + + 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); + } + + 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; + } + } +} diff --git a/src/alias/action/clip/ClipActionEditor.java b/src/main/java/io/github/dsheirer/alias/action/clip/ClipActionEditor.java similarity index 88% rename from src/alias/action/clip/ClipActionEditor.java rename to src/main/java/io/github/dsheirer/alias/action/clip/ClipActionEditor.java index 83b09cc2..b8d31a0a 100644 --- a/src/alias/action/clip/ClipActionEditor.java +++ b/src/main/java/io/github/dsheirer/alias/action/clip/ClipActionEditor.java @@ -15,34 +15,23 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias.action.clip; +package io.github.dsheirer.alias.action.clip; -import gui.editor.DocumentListenerEditor; +import io.github.dsheirer.alias.action.AliasAction; +import io.github.dsheirer.alias.action.RecurringAction; +import io.github.dsheirer.gui.editor.DocumentListenerEditor; +import net.miginfocom.swing.MigLayout; -import java.awt.Color; -import java.awt.Cursor; +import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.io.File; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JFileChooser; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JSlider; -import javax.swing.JTextField; -import javax.swing.SpinnerModel; -import javax.swing.SpinnerNumberModel; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - -import net.miginfocom.swing.MigLayout; -import alias.action.AliasAction; -import alias.action.RecurringAction.Interval; - public class ClipActionEditor extends DocumentListenerEditor { private static final long serialVersionUID = 1L; @@ -62,7 +51,7 @@ public class ClipActionEditor extends DocumentListenerEditor + "for 15 seconds after you click OK.
" + ""; - private JComboBox mComboInterval; + private JComboBox mComboInterval; private JSlider mPeriodSlider; private JLabel mPeriodSliderLabel; private JTextField mTextFilePath; @@ -90,20 +79,20 @@ public class ClipActionEditor extends DocumentListenerEditor add( new JLabel( "Play Interval:" ) ); - mComboInterval = new JComboBox( Interval.values() ); + mComboInterval = new JComboBox( RecurringAction.Interval.values() ); mComboInterval.setToolTipText( HELP_TEXT ); mComboInterval.addActionListener( new ActionListener() { @Override public void actionPerformed( ActionEvent e ) { - Interval selected = mComboInterval + RecurringAction.Interval selected = mComboInterval .getItemAt( mComboInterval.getSelectedIndex() ); if( selected != null ) { /* Enable/disable period slider based on selection */ - boolean enabled = selected != Interval.ONCE; + boolean enabled = selected != RecurringAction.Interval.ONCE; mPeriodSlider.setEnabled( enabled ); mPeriodSliderLabel.setEnabled( enabled ); @@ -186,7 +175,7 @@ public class ClipActionEditor extends DocumentListenerEditor if( path == null || path.trim().isEmpty() ) { JOptionPane.showMessageDialog( ClipActionEditor.this, - "Please select an audio file", PLEASE_SELECT_A_FILE, + "Please select an audio file", PLEASE_SELECT_A_FILE, JOptionPane.ERROR_MESSAGE ); } else @@ -218,7 +207,7 @@ public class ClipActionEditor extends DocumentListenerEditor catch( Exception e1 ) { JOptionPane.showMessageDialog( ClipActionEditor.this, - "Couldn't play audio clip [" + e1.getMessage() + "]", + "Couldn't play audio clip [" + e1.getMessage() + "]", "Error", JOptionPane.ERROR_MESSAGE ); } } @@ -254,11 +243,11 @@ public class ClipActionEditor extends DocumentListenerEditor { ClipAction clip = getClipAction(); - Interval interval = clip.getInterval(); + RecurringAction.Interval interval = clip.getInterval(); mComboInterval.setSelectedItem( interval ); - boolean enabled = interval != Interval.ONCE; + boolean enabled = interval != RecurringAction.Interval.ONCE; mPeriodSliderLabel.setEnabled( enabled ); mPeriodSlider.setEnabled( enabled ); @@ -286,7 +275,7 @@ public class ClipActionEditor extends DocumentListenerEditor { ClipAction script = getClipAction(); - script.setInterval( (Interval)mComboInterval.getSelectedItem() ); + script.setInterval( (RecurringAction.Interval)mComboInterval.getSelectedItem() ); script.setPeriod( mPeriodSlider.getValue() ); script.setPath( mTextFilePath.getText() ); } diff --git a/src/main/java/io/github/dsheirer/alias/action/script/ScriptAction.java b/src/main/java/io/github/dsheirer/alias/action/script/ScriptAction.java new file mode 100644 index 00000000..9aa920c2 --- /dev/null +++ b/src/main/java/io/github/dsheirer/alias/action/script/ScriptAction.java @@ -0,0 +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 java.io.BufferedReader; +import java.io.InputStreamReader; + +public class ScriptAction extends RecurringAction +{ + private final static Logger mLog = LoggerFactory.getLogger(ScriptAction.class); + + private String mScript; + + public ScriptAction() + { + } + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + @Override + public AliasActionType getType() + { + return AliasActionType.SCRIPT; + } + + 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); + + 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) + { + sb.append(line + "\n"); + } + + if(exitCode != 0) + { + throw new RuntimeException("Exit Code: " + exitCode + + " Console:" + sb.toString()); + } + } + } + + @Override + public String toString() + { + if(mScript == null) + { + return "Run Script"; + } + else + { + return "Run Script: " + mScript; + } + } +} diff --git a/src/alias/action/script/ScriptActionEditor.java b/src/main/java/io/github/dsheirer/alias/action/script/ScriptActionEditor.java similarity index 89% rename from src/alias/action/script/ScriptActionEditor.java rename to src/main/java/io/github/dsheirer/alias/action/script/ScriptActionEditor.java index a0593e42..533f1941 100644 --- a/src/alias/action/script/ScriptActionEditor.java +++ b/src/main/java/io/github/dsheirer/alias/action/script/ScriptActionEditor.java @@ -15,34 +15,23 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias.action.script; +package io.github.dsheirer.alias.action.script; -import gui.editor.DocumentListenerEditor; +import io.github.dsheirer.alias.action.AliasAction; +import io.github.dsheirer.alias.action.RecurringAction; +import io.github.dsheirer.gui.editor.DocumentListenerEditor; +import net.miginfocom.swing.MigLayout; -import java.awt.Color; -import java.awt.Cursor; +import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.io.File; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JFileChooser; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JSlider; -import javax.swing.JTextField; -import javax.swing.SpinnerModel; -import javax.swing.SpinnerNumberModel; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - -import net.miginfocom.swing.MigLayout; -import alias.action.AliasAction; -import alias.action.RecurringAction.Interval; - public class ScriptActionEditor extends DocumentListenerEditor { private static final long serialVersionUID = 1L; @@ -62,7 +51,7 @@ public class ScriptActionEditor extends DocumentListenerEditor + "for 15 seconds after you click OK.
" + ""; - private JComboBox mComboInterval; + private JComboBox mComboInterval; private JSlider mPeriodSlider; private JLabel mPeriodSliderLabel; private JTextField mTextFilePath; @@ -90,20 +79,20 @@ public class ScriptActionEditor extends DocumentListenerEditor add( new JLabel( "Run Interval:" ) ); - mComboInterval = new JComboBox( Interval.values() ); + mComboInterval = new JComboBox( RecurringAction.Interval.values() ); mComboInterval.setToolTipText( HELP_TEXT ); mComboInterval.addActionListener( new ActionListener() { @Override public void actionPerformed( ActionEvent e ) { - Interval selected = mComboInterval + RecurringAction.Interval selected = mComboInterval .getItemAt( mComboInterval.getSelectedIndex() ); if( selected != null ) { /* Enable/disable period slider based on selection */ - boolean enabled = selected != Interval.ONCE; + boolean enabled = selected != RecurringAction.Interval.ONCE; mPeriodSlider.setEnabled( enabled ); mPeriodSliderLabel.setEnabled( enabled ); @@ -250,11 +239,11 @@ public class ScriptActionEditor extends DocumentListenerEditor { ScriptAction script = getScriptAction(); - Interval interval = script.getInterval(); + RecurringAction.Interval interval = script.getInterval(); mComboInterval.setSelectedItem( interval ); - boolean enabled = interval != Interval.ONCE; + boolean enabled = interval != RecurringAction.Interval.ONCE; mPeriodSliderLabel.setEnabled( enabled ); mPeriodSlider.setEnabled( enabled ); @@ -282,7 +271,7 @@ public class ScriptActionEditor extends DocumentListenerEditor { ScriptAction script = getScriptAction(); - script.setInterval( (Interval)mComboInterval.getSelectedItem() ); + script.setInterval( (RecurringAction.Interval)mComboInterval.getSelectedItem() ); script.setPeriod( mPeriodSlider.getValue() ); script.setScript( mTextFilePath.getText() ); } diff --git a/src/main/java/io/github/dsheirer/alias/id/AliasID.java b/src/main/java/io/github/dsheirer/alias/id/AliasID.java new file mode 100644 index 00000000..0534f4a2 --- /dev/null +++ b/src/main/java/io/github/dsheirer/alias/id/AliasID.java @@ -0,0 +1,68 @@ +/******************************************************************************* + * 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 + ******************************************************************************/ +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; +import io.github.dsheirer.alias.id.lojack.LoJackFunctionAndID; +import io.github.dsheirer.alias.id.mdc.MDC1200ID; +import io.github.dsheirer.alias.id.mobileID.Min; +import io.github.dsheirer.alias.id.mpt1327.MPT1327ID; +import io.github.dsheirer.alias.id.nonrecordable.NonRecordable; +import io.github.dsheirer.alias.id.priority.Priority; +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; + +@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 ); + + @JsonIgnore + public abstract boolean isValid(); +} diff --git a/src/alias/id/AliasIDType.java b/src/main/java/io/github/dsheirer/alias/id/AliasIDType.java similarity index 97% rename from src/alias/id/AliasIDType.java rename to src/main/java/io/github/dsheirer/alias/id/AliasIDType.java index 6a71ff4f..bd95471e 100644 --- a/src/alias/id/AliasIDType.java +++ b/src/main/java/io/github/dsheirer/alias/id/AliasIDType.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias.id; +package io.github.dsheirer.alias.id; public enum AliasIDType { diff --git a/src/alias/id/AliasIdentifierEditor.java b/src/main/java/io/github/dsheirer/alias/id/AliasIdentifierEditor.java similarity index 92% rename from src/alias/id/AliasIdentifierEditor.java rename to src/main/java/io/github/dsheirer/alias/id/AliasIdentifierEditor.java index 0c20517d..d0d68901 100644 --- a/src/alias/id/AliasIdentifierEditor.java +++ b/src/main/java/io/github/dsheirer/alias/id/AliasIdentifierEditor.java @@ -15,13 +15,21 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias.id; +package io.github.dsheirer.alias.id; -import audio.broadcast.BroadcastModel; -import gui.editor.Editor; -import gui.editor.EmptyEditor; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasEvent; +import io.github.dsheirer.alias.AliasFactory; +import io.github.dsheirer.alias.AliasModel; +import io.github.dsheirer.audio.broadcast.BroadcastModel; +import io.github.dsheirer.gui.editor.Editor; +import io.github.dsheirer.gui.editor.EmptyEditor; +import net.miginfocom.swing.MigLayout; -import java.awt.EventQueue; +import javax.swing.*; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; @@ -30,26 +38,6 @@ import java.util.Collections; import java.util.Comparator; import java.util.List; -import javax.swing.DefaultListModel; -import javax.swing.JButton; -import javax.swing.JList; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JPopupMenu; -import javax.swing.JScrollPane; -import javax.swing.ListModel; -import javax.swing.ListSelectionModel; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; - -import net.miginfocom.swing.MigLayout; -import alias.Alias; -import alias.AliasEvent; -import alias.AliasEvent.Event; -import alias.AliasFactory; -import alias.AliasModel; - public class AliasIdentifierEditor extends Editor { private static final long serialVersionUID = 1L; @@ -204,7 +192,7 @@ public class AliasIdentifierEditor extends Editor alias.removeAliasID( selected ); - mAliasModel.broadcast( new AliasEvent( alias, Event.CHANGE ) ); + mAliasModel.broadcast( new AliasEvent( alias, AliasEvent.Event.CHANGE ) ); setItem( alias ); } @@ -263,7 +251,7 @@ public class AliasIdentifierEditor extends Editor if( hasItem() ) { - mAliasModel.broadcast( new AliasEvent( getItem(), Event.CHANGE ) ); + mAliasModel.broadcast( new AliasEvent( getItem(), AliasEvent.Event.CHANGE ) ); } } } @@ -307,7 +295,7 @@ public class AliasIdentifierEditor extends Editor { int option = JOptionPane.showConfirmDialog( EditorContainer.this, - "Identifier settings have changed. Do you want to save these changes?", + "Identifier settings have changed. Do you want to save these changes?", "Save Changes?", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE ); diff --git a/src/alias/id/WildcardID.java b/src/main/java/io/github/dsheirer/alias/id/WildcardID.java similarity index 99% rename from src/alias/id/WildcardID.java rename to src/main/java/io/github/dsheirer/alias/id/WildcardID.java index c5f47086..96d9a60b 100644 --- a/src/alias/id/WildcardID.java +++ b/src/main/java/io/github/dsheirer/alias/id/WildcardID.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package alias.id; +package io.github.dsheirer.alias.id; import org.apache.commons.lang3.Validate; diff --git a/src/alias/id/broadcast/BroadcastChannel.java b/src/main/java/io/github/dsheirer/alias/id/broadcast/BroadcastChannel.java similarity index 88% rename from src/alias/id/broadcast/BroadcastChannel.java rename to src/main/java/io/github/dsheirer/alias/id/broadcast/BroadcastChannel.java index 59a32090..d3aec77c 100644 --- a/src/alias/id/broadcast/BroadcastChannel.java +++ b/src/main/java/io/github/dsheirer/alias/id/broadcast/BroadcastChannel.java @@ -16,12 +16,11 @@ * along with this program. If not, see * ******************************************************************************/ -package alias.id.broadcast; +package io.github.dsheirer.alias.id.broadcast; -import alias.id.AliasID; -import alias.id.AliasIDType; - -import javax.xml.bind.annotation.XmlAttribute; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.github.dsheirer.alias.id.AliasID; +import io.github.dsheirer.alias.id.AliasIDType; public class BroadcastChannel extends AliasID implements Comparable { @@ -83,7 +82,7 @@ public class BroadcastChannel extends AliasID implements Comparable * ******************************************************************************/ -package alias.id.broadcast; +package io.github.dsheirer.alias.id.broadcast; -import alias.id.AliasID; -import audio.broadcast.BroadcastConfiguration; -import audio.broadcast.BroadcastModel; -import gui.editor.DocumentListenerEditor; +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 javax.swing.*; diff --git a/src/alias/id/esn/ESNEditor.java b/src/main/java/io/github/dsheirer/alias/id/esn/ESNEditor.java similarity index 92% rename from src/alias/id/esn/ESNEditor.java rename to src/main/java/io/github/dsheirer/alias/id/esn/ESNEditor.java index fd36ed47..06675ffc 100644 --- a/src/alias/id/esn/ESNEditor.java +++ b/src/main/java/io/github/dsheirer/alias/id/esn/ESNEditor.java @@ -15,22 +15,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias.id.esn; +package io.github.dsheirer.alias.id.esn; -import gui.editor.DocumentListenerEditor; +import io.github.dsheirer.alias.id.AliasID; +import io.github.dsheirer.gui.editor.DocumentListenerEditor; +import net.miginfocom.swing.MigLayout; -import java.awt.Color; -import java.awt.Cursor; +import javax.swing.*; +import java.awt.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JTextField; - -import net.miginfocom.swing.MigLayout; -import alias.id.AliasID; - public class ESNEditor extends DocumentListenerEditor { private static final long serialVersionUID = 1L; diff --git a/src/alias/id/esn/Esn.java b/src/main/java/io/github/dsheirer/alias/id/esn/Esn.java similarity index 81% rename from src/alias/id/esn/Esn.java rename to src/main/java/io/github/dsheirer/alias/id/esn/Esn.java index 5e2b5fc1..656c7793 100644 --- a/src/alias/id/esn/Esn.java +++ b/src/main/java/io/github/dsheirer/alias/id/esn/Esn.java @@ -15,12 +15,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias.id.esn; +package io.github.dsheirer.alias.id.esn; -import javax.xml.bind.annotation.XmlAttribute; - -import alias.id.AliasID; -import alias.id.AliasIDType; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.github.dsheirer.alias.id.AliasID; +import io.github.dsheirer.alias.id.AliasIDType; public class Esn extends AliasID { @@ -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() { diff --git a/src/alias/id/fleetsync/FleetsyncID.java b/src/main/java/io/github/dsheirer/alias/id/fleetsync/FleetsyncID.java similarity index 81% rename from src/alias/id/fleetsync/FleetsyncID.java rename to src/main/java/io/github/dsheirer/alias/id/fleetsync/FleetsyncID.java index 22b00872..19473bdf 100644 --- a/src/alias/id/fleetsync/FleetsyncID.java +++ b/src/main/java/io/github/dsheirer/alias/id/fleetsync/FleetsyncID.java @@ -15,13 +15,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias.id.fleetsync; - -import javax.xml.bind.annotation.XmlAttribute; - -import alias.id.AliasID; -import alias.id.AliasIDType; +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; public class FleetsyncID extends AliasID { @@ -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() { diff --git a/src/alias/id/fleetsync/FleetsyncIDEditor.java b/src/main/java/io/github/dsheirer/alias/id/fleetsync/FleetsyncIDEditor.java similarity index 92% rename from src/alias/id/fleetsync/FleetsyncIDEditor.java rename to src/main/java/io/github/dsheirer/alias/id/fleetsync/FleetsyncIDEditor.java index 64f8f531..89fe739c 100644 --- a/src/alias/id/fleetsync/FleetsyncIDEditor.java +++ b/src/main/java/io/github/dsheirer/alias/id/fleetsync/FleetsyncIDEditor.java @@ -15,27 +15,19 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias.id.fleetsync; - -import gui.editor.DocumentListenerEditor; - -import java.awt.Color; -import java.awt.Cursor; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; - -import javax.swing.JFormattedTextField; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JTextField; -import javax.swing.text.MaskFormatter; +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 alias.id.AliasID; +import javax.swing.*; +import javax.swing.text.MaskFormatter; +import java.awt.*; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; public class FleetsyncIDEditor extends DocumentListenerEditor { diff --git a/src/main/java/io/github/dsheirer/alias/id/lojack/LoJackFunctionAndID.java b/src/main/java/io/github/dsheirer/alias/id/lojack/LoJackFunctionAndID.java new file mode 100644 index 00000000..95f15688 --- /dev/null +++ b/src/main/java/io/github/dsheirer/alias/id/lojack/LoJackFunctionAndID.java @@ -0,0 +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 + ******************************************************************************/ +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; + +public class LoJackFunctionAndID extends AliasID +{ + private LJ1200Message.Function mFunction = LJ1200Message.Function.F0_UNKNOWN; + private String mID = "*****"; + + public LoJackFunctionAndID() + { + } + + @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; + } + + @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; + } +} diff --git a/src/alias/id/lojack/LoJackIDEditor.java b/src/main/java/io/github/dsheirer/alias/id/lojack/LoJackIDEditor.java similarity index 91% rename from src/alias/id/lojack/LoJackIDEditor.java rename to src/main/java/io/github/dsheirer/alias/id/lojack/LoJackIDEditor.java index 8c13e60e..85e9fc8e 100644 --- a/src/alias/id/lojack/LoJackIDEditor.java +++ b/src/main/java/io/github/dsheirer/alias/id/lojack/LoJackIDEditor.java @@ -15,29 +15,22 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias.id.lojack; +package io.github.dsheirer.alias.id.lojack; -import gui.editor.DocumentListenerEditor; +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 java.awt.Color; -import java.awt.Cursor; +import javax.swing.*; +import javax.swing.text.MaskFormatter; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import javax.swing.JComboBox; -import javax.swing.JFormattedTextField; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JTextField; -import javax.swing.text.MaskFormatter; - -import module.decode.lj1200.LJ1200Message; -import module.decode.lj1200.LJ1200Message.Function; -import net.miginfocom.swing.MigLayout; -import alias.id.AliasID; - public class LoJackIDEditor extends DocumentListenerEditor { private static final long serialVersionUID = 1L; diff --git a/src/main/java/io/github/dsheirer/alias/id/mdc/MDC1200ID.java b/src/main/java/io/github/dsheirer/alias/id/mdc/MDC1200ID.java new file mode 100644 index 00000000..e8f50df7 --- /dev/null +++ b/src/main/java/io/github/dsheirer/alias/id/mdc/MDC1200ID.java @@ -0,0 +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 + ******************************************************************************/ +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; + +public class MDC1200ID extends AliasID +{ + private String mID; + + public MDC1200ID() + { + } + + @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; + } +} diff --git a/src/alias/id/mdc/MDC1200IDEditor.java b/src/main/java/io/github/dsheirer/alias/id/mdc/MDC1200IDEditor.java similarity index 92% rename from src/alias/id/mdc/MDC1200IDEditor.java rename to src/main/java/io/github/dsheirer/alias/id/mdc/MDC1200IDEditor.java index 21437cb9..e688421e 100644 --- a/src/alias/id/mdc/MDC1200IDEditor.java +++ b/src/main/java/io/github/dsheirer/alias/id/mdc/MDC1200IDEditor.java @@ -15,24 +15,18 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias.id.mdc; +package io.github.dsheirer.alias.id.mdc; -import gui.editor.DocumentListenerEditor; +import io.github.dsheirer.alias.id.AliasID; +import io.github.dsheirer.gui.editor.DocumentListenerEditor; +import net.miginfocom.swing.MigLayout; -import java.awt.Color; -import java.awt.Cursor; +import javax.swing.*; +import javax.swing.text.MaskFormatter; +import java.awt.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import javax.swing.JFormattedTextField; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JTextField; -import javax.swing.text.MaskFormatter; - -import net.miginfocom.swing.MigLayout; -import alias.id.AliasID; - public class MDC1200IDEditor extends DocumentListenerEditor { private static final long serialVersionUID = 1L; diff --git a/src/alias/id/mobileID/MINEditor.java b/src/main/java/io/github/dsheirer/alias/id/mobileID/MINEditor.java similarity index 91% rename from src/alias/id/mobileID/MINEditor.java rename to src/main/java/io/github/dsheirer/alias/id/mobileID/MINEditor.java index 6244ff69..ff2a4f8d 100644 --- a/src/alias/id/mobileID/MINEditor.java +++ b/src/main/java/io/github/dsheirer/alias/id/mobileID/MINEditor.java @@ -15,24 +15,18 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias.id.mobileID; +package io.github.dsheirer.alias.id.mobileID; -import gui.editor.DocumentListenerEditor; +import io.github.dsheirer.alias.id.AliasID; +import io.github.dsheirer.gui.editor.DocumentListenerEditor; +import net.miginfocom.swing.MigLayout; -import java.awt.Color; -import java.awt.Cursor; +import javax.swing.*; +import javax.swing.text.MaskFormatter; +import java.awt.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import javax.swing.JFormattedTextField; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JTextField; -import javax.swing.text.MaskFormatter; - -import net.miginfocom.swing.MigLayout; -import alias.id.AliasID; - public class MINEditor extends DocumentListenerEditor { private static final long serialVersionUID = 1L; diff --git a/src/main/java/io/github/dsheirer/alias/id/mobileID/Min.java b/src/main/java/io/github/dsheirer/alias/id/mobileID/Min.java new file mode 100644 index 00000000..aec0eb72 --- /dev/null +++ b/src/main/java/io/github/dsheirer/alias/id/mobileID/Min.java @@ -0,0 +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 + ******************************************************************************/ +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; + +/** + * Mobile ID Number + */ +public class Min extends AliasID +{ + private String mMin; + + public Min() + { + } + + @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; + } +} diff --git a/src/main/java/io/github/dsheirer/alias/id/mpt1327/MPT1327ID.java b/src/main/java/io/github/dsheirer/alias/id/mpt1327/MPT1327ID.java new file mode 100644 index 00000000..53208bbb --- /dev/null +++ b/src/main/java/io/github/dsheirer/alias/id/mpt1327/MPT1327ID.java @@ -0,0 +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 + ******************************************************************************/ +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; + +public class MPT1327ID extends AliasID +{ + private String mID; + + public MPT1327ID() + { + } + + @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; + } +} diff --git a/src/alias/id/mpt1327/MPT1327IDEditor.java b/src/main/java/io/github/dsheirer/alias/id/mpt1327/MPT1327IDEditor.java similarity index 92% rename from src/alias/id/mpt1327/MPT1327IDEditor.java rename to src/main/java/io/github/dsheirer/alias/id/mpt1327/MPT1327IDEditor.java index 4bbfc8fe..6ce3ccad 100644 --- a/src/alias/id/mpt1327/MPT1327IDEditor.java +++ b/src/main/java/io/github/dsheirer/alias/id/mpt1327/MPT1327IDEditor.java @@ -15,24 +15,18 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias.id.mpt1327; +package io.github.dsheirer.alias.id.mpt1327; -import gui.editor.DocumentListenerEditor; +import io.github.dsheirer.alias.id.AliasID; +import io.github.dsheirer.gui.editor.DocumentListenerEditor; +import net.miginfocom.swing.MigLayout; -import java.awt.Color; -import java.awt.Cursor; +import javax.swing.*; +import javax.swing.text.MaskFormatter; +import java.awt.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import javax.swing.JFormattedTextField; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JTextField; -import javax.swing.text.MaskFormatter; - -import net.miginfocom.swing.MigLayout; -import alias.id.AliasID; - public class MPT1327IDEditor extends DocumentListenerEditor { private static final long serialVersionUID = 1L; diff --git a/src/main/java/io/github/dsheirer/alias/id/nonrecordable/NonRecordable.java b/src/main/java/io/github/dsheirer/alias/id/nonrecordable/NonRecordable.java new file mode 100644 index 00000000..b6a2fcb9 --- /dev/null +++ b/src/main/java/io/github/dsheirer/alias/id/nonrecordable/NonRecordable.java @@ -0,0 +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 +{ + @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 matches(AliasID id) + { + return false; + } + + @Override + public String toString() + { + return "Audio Non-Recordable"; + } +} diff --git a/src/alias/id/nonrecordable/NonRecordableEditor.java b/src/main/java/io/github/dsheirer/alias/id/nonrecordable/NonRecordableEditor.java similarity index 91% rename from src/alias/id/nonrecordable/NonRecordableEditor.java rename to src/main/java/io/github/dsheirer/alias/id/nonrecordable/NonRecordableEditor.java index 6f402371..02726cc9 100644 --- a/src/alias/id/nonrecordable/NonRecordableEditor.java +++ b/src/main/java/io/github/dsheirer/alias/id/nonrecordable/NonRecordableEditor.java @@ -15,21 +15,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias.id.nonrecordable; +package io.github.dsheirer.alias.id.nonrecordable; -import gui.editor.DocumentListenerEditor; +import io.github.dsheirer.alias.id.AliasID; +import io.github.dsheirer.gui.editor.DocumentListenerEditor; +import net.miginfocom.swing.MigLayout; -import java.awt.Color; -import java.awt.Cursor; +import javax.swing.*; +import java.awt.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import javax.swing.JLabel; -import javax.swing.JOptionPane; - -import net.miginfocom.swing.MigLayout; -import alias.id.AliasID; - public class NonRecordableEditor extends DocumentListenerEditor { private static final long serialVersionUID = 1L; diff --git a/src/main/java/io/github/dsheirer/alias/id/priority/Priority.java b/src/main/java/io/github/dsheirer/alias/id/priority/Priority.java new file mode 100644 index 00000000..6184c8ff --- /dev/null +++ b/src/main/java/io/github/dsheirer/alias/id/priority/Priority.java @@ -0,0 +1,85 @@ +/******************************************************************************* + * SDR Trunk + * Copyright (C) 2014 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + ******************************************************************************/ +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; + +/** + * 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() + { + } + + @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; + } +} diff --git a/src/alias/id/priority/PriorityEditor.java b/src/main/java/io/github/dsheirer/alias/id/priority/PriorityEditor.java similarity index 94% rename from src/alias/id/priority/PriorityEditor.java rename to src/main/java/io/github/dsheirer/alias/id/priority/PriorityEditor.java index 5b797991..767625c5 100644 --- a/src/alias/id/priority/PriorityEditor.java +++ b/src/main/java/io/github/dsheirer/alias/id/priority/PriorityEditor.java @@ -15,23 +15,18 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias.id.priority; +package io.github.dsheirer.alias.id.priority; -import gui.editor.DocumentListenerEditor; +import io.github.dsheirer.alias.id.AliasID; +import io.github.dsheirer.gui.editor.DocumentListenerEditor; +import net.miginfocom.swing.MigLayout; -import java.awt.Color; -import java.awt.Cursor; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; - -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JSlider; +import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; - -import net.miginfocom.swing.MigLayout; -import alias.id.AliasID; +import java.awt.*; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; public class PriorityEditor extends DocumentListenerEditor { diff --git a/src/playlist/version1/System.java b/src/main/java/io/github/dsheirer/alias/id/siteID/SiteID.java similarity index 50% rename from src/playlist/version1/System.java rename to src/main/java/io/github/dsheirer/alias/id/siteID/SiteID.java index 548bff7d..acf3016e 100644 --- a/src/playlist/version1/System.java +++ b/src/main/java/io/github/dsheirer/alias/id/siteID/SiteID.java @@ -1,84 +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 ******************************************************************************/ -package playlist.version1; +package io.github.dsheirer.alias.id.siteID; -import java.util.ArrayList; +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; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; - -@XmlSeeAlso( { Site.class } ) -@XmlRootElement( name = "system" ) -@Deprecated -public class System +public class SiteID extends AliasID { - private String mName; - private ArrayList mSite = new ArrayList(); + private String mSite; - public System() + public SiteID() { - this( "New System" ); } - - public System( String name ) - { - mName = name; - } - - @XmlAttribute - public String getName() - { - return mName; - } - - public void setName( String name ) - { - mName = name; - } - - public ArrayList getSite() + + @JacksonXmlProperty(isAttribute = true, localName = "site") + public String getSite() { return mSite; } - - public void setSite( ArrayList sites ) + + public void setSite(String site) { - mSite = sites; + mSite = site; } - - public void addSite( Site site ) + + @Override + public boolean isValid() { - mSite.add( site ); + return mSite != null; } - - public void removeSite( Site site ) - { - mSite.remove( site ); - } - - public void clearSites() - { - mSite.clear(); - } - + public String toString() { - return mName; + 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; } } diff --git a/src/alias/id/siteID/SiteIDEditor.java b/src/main/java/io/github/dsheirer/alias/id/siteID/SiteIDEditor.java similarity index 92% rename from src/alias/id/siteID/SiteIDEditor.java rename to src/main/java/io/github/dsheirer/alias/id/siteID/SiteIDEditor.java index 7df5fa7a..aa87fcee 100644 --- a/src/alias/id/siteID/SiteIDEditor.java +++ b/src/main/java/io/github/dsheirer/alias/id/siteID/SiteIDEditor.java @@ -15,22 +15,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias.id.siteID; +package io.github.dsheirer.alias.id.siteID; -import gui.editor.DocumentListenerEditor; +import io.github.dsheirer.alias.id.AliasID; +import io.github.dsheirer.gui.editor.DocumentListenerEditor; +import net.miginfocom.swing.MigLayout; -import java.awt.Color; -import java.awt.Cursor; +import javax.swing.*; +import java.awt.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JTextField; - -import net.miginfocom.swing.MigLayout; -import alias.id.AliasID; - public class SiteIDEditor extends DocumentListenerEditor { private static final long serialVersionUID = 1L; diff --git a/src/main/java/io/github/dsheirer/alias/id/status/StatusID.java b/src/main/java/io/github/dsheirer/alias/id/status/StatusID.java new file mode 100644 index 00000000..24050b1a --- /dev/null +++ b/src/main/java/io/github/dsheirer/alias/id/status/StatusID.java @@ -0,0 +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 + ******************************************************************************/ +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; + +public class StatusID extends AliasID +{ + private int mStatus; + + public StatusID() + { + } + + @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; + } +} diff --git a/src/alias/id/status/StatusIDEditor.java b/src/main/java/io/github/dsheirer/alias/id/status/StatusIDEditor.java similarity index 92% rename from src/alias/id/status/StatusIDEditor.java rename to src/main/java/io/github/dsheirer/alias/id/status/StatusIDEditor.java index e4dc8e3d..69a4b996 100644 --- a/src/alias/id/status/StatusIDEditor.java +++ b/src/main/java/io/github/dsheirer/alias/id/status/StatusIDEditor.java @@ -15,24 +15,18 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias.id.status; +package io.github.dsheirer.alias.id.status; -import gui.editor.DocumentListenerEditor; +import io.github.dsheirer.alias.id.AliasID; +import io.github.dsheirer.gui.editor.DocumentListenerEditor; +import net.miginfocom.swing.MigLayout; -import java.awt.Color; -import java.awt.Cursor; +import javax.swing.*; +import javax.swing.text.MaskFormatter; +import java.awt.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import javax.swing.JFormattedTextField; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JTextField; -import javax.swing.text.MaskFormatter; - -import net.miginfocom.swing.MigLayout; -import alias.id.AliasID; - public class StatusIDEditor extends DocumentListenerEditor { private static final long serialVersionUID = 1L; diff --git a/src/alias/id/talkgroup/TalkgroupID.java b/src/main/java/io/github/dsheirer/alias/id/talkgroup/TalkgroupID.java similarity index 81% rename from src/alias/id/talkgroup/TalkgroupID.java rename to src/main/java/io/github/dsheirer/alias/id/talkgroup/TalkgroupID.java index cb2e8097..c70accbd 100644 --- a/src/alias/id/talkgroup/TalkgroupID.java +++ b/src/main/java/io/github/dsheirer/alias/id/talkgroup/TalkgroupID.java @@ -15,13 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias.id.talkgroup; +package io.github.dsheirer.alias.id.talkgroup; -import alias.id.AliasID; -import alias.id.AliasIDType; - -import javax.xml.bind.annotation.XmlAttribute; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.github.dsheirer.alias.id.AliasID; +import io.github.dsheirer.alias.id.AliasIDType; public class TalkgroupID extends AliasID { @@ -37,7 +36,7 @@ public class TalkgroupID extends AliasID mTalkgroup = talkgroup; } - @XmlAttribute + @JacksonXmlProperty(isAttribute = true, localName = "talkgroup") public String getTalkgroup() { return mTalkgroup; @@ -70,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("*", ".?"); @@ -81,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() { diff --git a/src/alias/id/talkgroup/TalkgroupIDEditor.java b/src/main/java/io/github/dsheirer/alias/id/talkgroup/TalkgroupIDEditor.java similarity index 92% rename from src/alias/id/talkgroup/TalkgroupIDEditor.java rename to src/main/java/io/github/dsheirer/alias/id/talkgroup/TalkgroupIDEditor.java index 6a63faf6..8cf061c5 100644 --- a/src/alias/id/talkgroup/TalkgroupIDEditor.java +++ b/src/main/java/io/github/dsheirer/alias/id/talkgroup/TalkgroupIDEditor.java @@ -15,22 +15,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias.id.talkgroup; +package io.github.dsheirer.alias.id.talkgroup; -import gui.editor.DocumentListenerEditor; +import io.github.dsheirer.alias.id.AliasID; +import io.github.dsheirer.gui.editor.DocumentListenerEditor; +import net.miginfocom.swing.MigLayout; -import java.awt.Color; -import java.awt.Cursor; +import javax.swing.*; +import java.awt.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JTextField; - -import net.miginfocom.swing.MigLayout; -import alias.id.AliasID; - public class TalkgroupIDEditor extends DocumentListenerEditor { private static final long serialVersionUID = 1L; diff --git a/src/main/java/io/github/dsheirer/alias/id/uniqueID/UniqueID.java b/src/main/java/io/github/dsheirer/alias/id/uniqueID/UniqueID.java new file mode 100644 index 00000000..5b2e1f77 --- /dev/null +++ b/src/main/java/io/github/dsheirer/alias/id/uniqueID/UniqueID.java @@ -0,0 +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 + ******************************************************************************/ +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; + +public class UniqueID extends AliasID +{ + private int mUid; + + public UniqueID() + { + } + + @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; + } +} diff --git a/src/alias/id/uniqueID/UniqueIDEditor.java b/src/main/java/io/github/dsheirer/alias/id/uniqueID/UniqueIDEditor.java similarity index 92% rename from src/alias/id/uniqueID/UniqueIDEditor.java rename to src/main/java/io/github/dsheirer/alias/id/uniqueID/UniqueIDEditor.java index ea0aa3be..01053c51 100644 --- a/src/alias/id/uniqueID/UniqueIDEditor.java +++ b/src/main/java/io/github/dsheirer/alias/id/uniqueID/UniqueIDEditor.java @@ -15,22 +15,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package alias.id.uniqueID; +package io.github.dsheirer.alias.id.uniqueID; -import gui.editor.DocumentListenerEditor; +import io.github.dsheirer.alias.id.AliasID; +import io.github.dsheirer.gui.editor.DocumentListenerEditor; +import net.miginfocom.swing.MigLayout; -import java.awt.Color; -import java.awt.Cursor; +import javax.swing.*; +import java.awt.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JTextField; - -import net.miginfocom.swing.MigLayout; -import alias.id.AliasID; - public class UniqueIDEditor extends DocumentListenerEditor { private static final long serialVersionUID = 1L; diff --git a/src/audio/AudioChannelPanel.java b/src/main/java/io/github/dsheirer/audio/AudioChannelPanel.java similarity index 93% rename from src/audio/AudioChannelPanel.java rename to src/main/java/io/github/dsheirer/audio/AudioChannelPanel.java index 8d659173..7e6c1aa3 100644 --- a/src/audio/AudioChannelPanel.java +++ b/src/main/java/io/github/dsheirer/audio/AudioChannelPanel.java @@ -16,22 +16,21 @@ * along with this program. If not, see * ******************************************************************************/ -package audio; +package io.github.dsheirer.audio; -import alias.Alias; -import audio.output.AudioOutput; -import channel.metadata.Metadata; -import icon.IconManager; +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; +import io.github.dsheirer.properties.SystemProperties; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.settings.ColorSetting; +import io.github.dsheirer.settings.Setting; +import io.github.dsheirer.settings.SettingChangeListener; +import io.github.dsheirer.settings.SettingsManager; import net.miginfocom.swing.MigLayout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import properties.SystemProperties; -import sample.Listener; -import settings.ColorSetting; -import settings.ColorSetting.ColorSettingName; -import settings.Setting; -import settings.SettingChangeListener; -import settings.SettingsManager; import javax.swing.*; import java.awt.*; diff --git a/src/audio/AudioChannelsPanel.java b/src/main/java/io/github/dsheirer/audio/AudioChannelsPanel.java similarity index 92% rename from src/audio/AudioChannelsPanel.java rename to src/main/java/io/github/dsheirer/audio/AudioChannelsPanel.java index ebfc1b9b..a3db071b 100644 --- a/src/audio/AudioChannelsPanel.java +++ b/src/main/java/io/github/dsheirer/audio/AudioChannelsPanel.java @@ -16,12 +16,12 @@ * along with this program. If not, see * ******************************************************************************/ -package audio; +package io.github.dsheirer.audio; -import audio.output.AudioOutput; -import icon.IconManager; +import io.github.dsheirer.audio.output.AudioOutput; +import io.github.dsheirer.icon.IconManager; +import io.github.dsheirer.settings.SettingsManager; import net.miginfocom.swing.MigLayout; -import settings.SettingsManager; import javax.swing.*; import java.awt.*; diff --git a/src/audio/AudioEvent.java b/src/main/java/io/github/dsheirer/audio/AudioEvent.java similarity index 93% rename from src/audio/AudioEvent.java rename to src/main/java/io/github/dsheirer/audio/AudioEvent.java index ca166059..c77a6ea2 100644 --- a/src/audio/AudioEvent.java +++ b/src/main/java/io/github/dsheirer/audio/AudioEvent.java @@ -1,4 +1,4 @@ -package audio; +package io.github.dsheirer.audio; public class AudioEvent { diff --git a/src/audio/AudioException.java b/src/main/java/io/github/dsheirer/audio/AudioException.java similarity index 89% rename from src/audio/AudioException.java rename to src/main/java/io/github/dsheirer/audio/AudioException.java index 365b605c..f3374b34 100644 --- a/src/audio/AudioException.java +++ b/src/main/java/io/github/dsheirer/audio/AudioException.java @@ -1,4 +1,4 @@ -package audio; +package io.github.dsheirer.audio; public class AudioException extends Exception { diff --git a/src/audio/AudioFormats.java b/src/main/java/io/github/dsheirer/audio/AudioFormats.java similarity index 98% rename from src/audio/AudioFormats.java rename to src/main/java/io/github/dsheirer/audio/AudioFormats.java index ac859f54..c6cbed82 100644 --- a/src/audio/AudioFormats.java +++ b/src/main/java/io/github/dsheirer/audio/AudioFormats.java @@ -1,4 +1,4 @@ -package audio; +package io.github.dsheirer.audio; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.DataLine; @@ -72,13 +72,13 @@ public class AudioFormats LITTLE_ENDIAN ); /** - * Source Data Line Info for a 48 kHz, 16-bits signed PCM one channel + * Source Data Line Info for a 48 kHz, 16-bits signed PCM one channel */ public static final Line.Info MONO_SOURCE_DATALINE_INFO = new DataLine.Info( SourceDataLine.class, PCM_SIGNED_8KHZ_16BITS_MONO); /** - * Source Data Line Info for a 48 kHz, 16-bits signed PCM two channels + * Source Data Line Info for a 48 kHz, 16-bits signed PCM two channels */ public static final Line.Info STEREO_SOURCE_DATALINE_INFO = new DataLine.Info( SourceDataLine.class, PCM_SIGNED_8KHZ_16BITS_STEREO); diff --git a/src/audio/AudioManager.java b/src/main/java/io/github/dsheirer/audio/AudioManager.java similarity index 96% rename from src/audio/AudioManager.java rename to src/main/java/io/github/dsheirer/audio/AudioManager.java index 4d6c57ac..c0f1d877 100644 --- a/src/audio/AudioManager.java +++ b/src/main/java/io/github/dsheirer/audio/AudioManager.java @@ -16,21 +16,20 @@ * along with this program. If not, see * ******************************************************************************/ -package audio; +package io.github.dsheirer.audio; -import audio.AudioEvent.Type; -import audio.output.AudioOutput; -import audio.output.MonoAudioOutput; -import audio.output.StereoAudioOutput; +import io.github.dsheirer.audio.output.AudioOutput; +import io.github.dsheirer.audio.output.MonoAudioOutput; +import io.github.dsheirer.audio.output.StereoAudioOutput; +import io.github.dsheirer.properties.SystemProperties; +import io.github.dsheirer.sample.Broadcaster; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.source.mixer.MixerChannel; +import io.github.dsheirer.source.mixer.MixerChannelConfiguration; +import io.github.dsheirer.source.mixer.MixerManager; +import io.github.dsheirer.util.ThreadPool; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import properties.SystemProperties; -import sample.Broadcaster; -import sample.Listener; -import source.mixer.MixerChannel; -import source.mixer.MixerChannelConfiguration; -import source.mixer.MixerManager; -import util.ThreadPool; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.Mixer; @@ -54,10 +53,10 @@ public class AudioManager implements Listener, IAudioController public static final String AUDIO_MIXER_PROPERTY = "audio.manager.mixer"; public static final AudioEvent CONFIGURATION_CHANGE_STARTED = - new AudioEvent(Type.AUDIO_CONFIGURATION_CHANGE_STARTED, null); + new AudioEvent(AudioEvent.Type.AUDIO_CONFIGURATION_CHANGE_STARTED, null); public static final AudioEvent CONFIGURATION_CHANGE_COMPLETE = - new AudioEvent(Type.AUDIO_CONFIGURATION_CHANGE_COMPLETE, null); + new AudioEvent(AudioEvent.Type.AUDIO_CONFIGURATION_CHANGE_COMPLETE, null); private LinkedTransferQueue mAudioPacketQueue = new LinkedTransferQueue<>(); private Map mChannelConnectionMap = new HashMap<>(); diff --git a/src/audio/AudioModule.java b/src/main/java/io/github/dsheirer/audio/AudioModule.java similarity index 88% rename from src/audio/AudioModule.java rename to src/main/java/io/github/dsheirer/audio/AudioModule.java index 58b0be0f..369dd8ed 100644 --- a/src/audio/AudioModule.java +++ b/src/main/java/io/github/dsheirer/audio/AudioModule.java @@ -16,21 +16,21 @@ * along with this program. If not, see * ******************************************************************************/ -package audio; +package io.github.dsheirer.audio; -import audio.squelch.ISquelchStateListener; -import audio.squelch.SquelchState; -import channel.metadata.Metadata; -import dsp.filter.design.FilterDesignException; -import dsp.filter.fir.FIRFilterSpecification; -import dsp.filter.fir.remez.RemezFIRFilterDesigner; -import dsp.filter.polyphase.PolyphaseFIRDecimatingFilter_RB; -import module.Module; +import io.github.dsheirer.audio.squelch.ISquelchStateListener; +import io.github.dsheirer.audio.squelch.SquelchState; +import io.github.dsheirer.channel.metadata.Metadata; +import io.github.dsheirer.dsp.filter.design.FilterDesignException; +import io.github.dsheirer.dsp.filter.fir.FIRFilterSpecification; +import io.github.dsheirer.dsp.filter.fir.remez.RemezFIRFilterDesigner; +import io.github.dsheirer.dsp.filter.polyphase.PolyphaseFIRDecimatingFilter_RB; +import io.github.dsheirer.module.Module; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.IFilteredRealBufferListener; +import io.github.dsheirer.sample.real.RealBuffer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; -import sample.real.IFilteredRealBufferListener; -import sample.real.RealBuffer; import java.util.concurrent.ScheduledExecutorService; diff --git a/src/audio/AudioPacket.java b/src/main/java/io/github/dsheirer/audio/AudioPacket.java similarity index 92% rename from src/audio/AudioPacket.java rename to src/main/java/io/github/dsheirer/audio/AudioPacket.java index aa655975..a57f2bdb 100644 --- a/src/audio/AudioPacket.java +++ b/src/main/java/io/github/dsheirer/audio/AudioPacket.java @@ -16,10 +16,10 @@ * along with this program. If not, see * ******************************************************************************/ -package audio; +package io.github.dsheirer.audio; -import channel.metadata.Metadata; -import sample.real.RealBuffer; +import io.github.dsheirer.channel.metadata.Metadata; +import io.github.dsheirer.sample.real.RealBuffer; public class AudioPacket { diff --git a/src/audio/AudioPacketRateCounter.java b/src/main/java/io/github/dsheirer/audio/AudioPacketRateCounter.java similarity index 92% rename from src/audio/AudioPacketRateCounter.java rename to src/main/java/io/github/dsheirer/audio/AudioPacketRateCounter.java index 99835a90..fbc7ea0d 100644 --- a/src/audio/AudioPacketRateCounter.java +++ b/src/main/java/io/github/dsheirer/audio/AudioPacketRateCounter.java @@ -1,10 +1,9 @@ -package audio; +package io.github.dsheirer.audio; +import io.github.dsheirer.sample.Listener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; - public class AudioPacketRateCounter implements Listener { private final static Logger mLog = diff --git a/src/audio/AudioPanel.java b/src/main/java/io/github/dsheirer/audio/AudioPanel.java similarity index 97% rename from src/audio/AudioPanel.java rename to src/main/java/io/github/dsheirer/audio/AudioPanel.java index e91ecacf..fda419c4 100644 --- a/src/audio/AudioPanel.java +++ b/src/main/java/io/github/dsheirer/audio/AudioPanel.java @@ -16,17 +16,17 @@ * along with this program. If not, see * ******************************************************************************/ -package audio; +package io.github.dsheirer.audio; -import audio.output.AudioOutput; -import icon.IconManager; +import io.github.dsheirer.audio.output.AudioOutput; +import io.github.dsheirer.icon.IconManager; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.settings.SettingsManager; +import io.github.dsheirer.source.SourceManager; +import io.github.dsheirer.source.mixer.MixerChannelConfiguration; import net.miginfocom.swing.MigLayout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; -import settings.SettingsManager; -import source.SourceManager; -import source.mixer.MixerChannelConfiguration; import javax.sound.sampled.FloatControl; import javax.swing.*; diff --git a/src/audio/AudioUtils.java b/src/main/java/io/github/dsheirer/audio/AudioUtils.java similarity index 95% rename from src/audio/AudioUtils.java rename to src/main/java/io/github/dsheirer/audio/AudioUtils.java index fac396f9..08b4d3d8 100644 --- a/src/audio/AudioUtils.java +++ b/src/main/java/io/github/dsheirer/audio/AudioUtils.java @@ -16,12 +16,11 @@ * along with this program. If not, see * ******************************************************************************/ -package audio; +package io.github.dsheirer.audio; +import io.github.dsheirer.sample.ConversionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import record.wave.RealBufferWaveRecorder; -import sample.ConversionUtils; import java.io.ByteArrayOutputStream; import java.io.IOException; diff --git a/src/audio/IAudioController.java b/src/main/java/io/github/dsheirer/audio/IAudioController.java similarity index 76% rename from src/audio/IAudioController.java rename to src/main/java/io/github/dsheirer/audio/IAudioController.java index 4b12b6d0..a6fe007b 100644 --- a/src/audio/IAudioController.java +++ b/src/main/java/io/github/dsheirer/audio/IAudioController.java @@ -1,11 +1,11 @@ -package audio; +package io.github.dsheirer.audio; + +import io.github.dsheirer.audio.output.AudioOutput; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.source.mixer.MixerChannelConfiguration; import java.util.List; -import sample.Listener; -import source.mixer.MixerChannelConfiguration; -import audio.output.AudioOutput; - /** * Interface for controlling one or more audio channels */ diff --git a/src/audio/IAudioPacketListener.java b/src/main/java/io/github/dsheirer/audio/IAudioPacketListener.java similarity index 56% rename from src/audio/IAudioPacketListener.java rename to src/main/java/io/github/dsheirer/audio/IAudioPacketListener.java index 298f5e1c..96833a73 100644 --- a/src/audio/IAudioPacketListener.java +++ b/src/main/java/io/github/dsheirer/audio/IAudioPacketListener.java @@ -1,6 +1,6 @@ -package audio; +package io.github.dsheirer.audio; -import sample.Listener; +import io.github.dsheirer.sample.Listener; public interface IAudioPacketListener { diff --git a/src/audio/IAudioPacketProvider.java b/src/main/java/io/github/dsheirer/audio/IAudioPacketProvider.java similarity index 67% rename from src/audio/IAudioPacketProvider.java rename to src/main/java/io/github/dsheirer/audio/IAudioPacketProvider.java index 47f4b0be..b6623cee 100644 --- a/src/audio/IAudioPacketProvider.java +++ b/src/main/java/io/github/dsheirer/audio/IAudioPacketProvider.java @@ -1,6 +1,6 @@ -package audio; +package io.github.dsheirer.audio; -import sample.Listener; +import io.github.dsheirer.sample.Listener; public interface IAudioPacketProvider { diff --git a/src/audio/InversionFrequency.java b/src/main/java/io/github/dsheirer/audio/InversionFrequency.java similarity index 97% rename from src/audio/InversionFrequency.java rename to src/main/java/io/github/dsheirer/audio/InversionFrequency.java index da493f19..071dc8bd 100644 --- a/src/audio/InversionFrequency.java +++ b/src/main/java/io/github/dsheirer/audio/InversionFrequency.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package audio; +package io.github.dsheirer.audio; /** * Standard voice inversion foldover frequencies diff --git a/src/audio/broadcast/AudioBroadcaster.java b/src/main/java/io/github/dsheirer/audio/broadcast/AudioBroadcaster.java similarity index 98% rename from src/audio/broadcast/AudioBroadcaster.java rename to src/main/java/io/github/dsheirer/audio/broadcast/AudioBroadcaster.java index 3cb4c309..413bbdf1 100644 --- a/src/audio/broadcast/AudioBroadcaster.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/AudioBroadcaster.java @@ -16,14 +16,14 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast; +package io.github.dsheirer.audio.broadcast; -import audio.convert.ISilenceGenerator; -import channel.metadata.Metadata; +import io.github.dsheirer.audio.convert.ISilenceGenerator; +import io.github.dsheirer.channel.metadata.Metadata; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.util.ThreadPool; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; -import util.ThreadPool; import java.io.ByteArrayInputStream; import java.io.IOException; diff --git a/src/audio/broadcast/AudioRecording.java b/src/main/java/io/github/dsheirer/audio/broadcast/AudioRecording.java similarity index 97% rename from src/audio/broadcast/AudioRecording.java rename to src/main/java/io/github/dsheirer/audio/broadcast/AudioRecording.java index f80a0c66..5edbe272 100644 --- a/src/audio/broadcast/AudioRecording.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/AudioRecording.java @@ -16,9 +16,9 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast; +package io.github.dsheirer.audio.broadcast; -import channel.metadata.Metadata; +import io.github.dsheirer.channel.metadata.Metadata; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/audio/broadcast/BroadcastConfiguration.java b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastConfiguration.java similarity index 78% rename from src/audio/broadcast/BroadcastConfiguration.java rename to src/main/java/io/github/dsheirer/audio/broadcast/BroadcastConfiguration.java index 2a2ee63b..220416e5 100644 --- a/src/audio/broadcast/BroadcastConfiguration.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastConfiguration.java @@ -16,27 +16,27 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast; +package io.github.dsheirer.audio.broadcast; -import audio.broadcast.broadcastify.BroadcastifyConfiguration; -import audio.broadcast.icecast.IcecastHTTPConfiguration; -import audio.broadcast.icecast.IcecastTCPConfiguration; -import audio.broadcast.shoutcast.v1.ShoutcastV1Configuration; -import audio.broadcast.shoutcast.v2.ShoutcastV2Configuration; +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; diff --git a/src/audio/broadcast/BroadcastConfigurationEditor.java b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastConfigurationEditor.java similarity index 95% rename from src/audio/broadcast/BroadcastConfigurationEditor.java rename to src/main/java/io/github/dsheirer/audio/broadcast/BroadcastConfigurationEditor.java index 4c1b5f71..bb5b9a18 100644 --- a/src/audio/broadcast/BroadcastConfigurationEditor.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastConfigurationEditor.java @@ -16,11 +16,11 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast; +package io.github.dsheirer.audio.broadcast; -import alias.AliasModel; -import gui.editor.DocumentListenerEditor; -import icon.IconManager; +import io.github.dsheirer.alias.AliasModel; +import io.github.dsheirer.gui.editor.DocumentListenerEditor; +import io.github.dsheirer.icon.IconManager; import javax.swing.*; diff --git a/src/audio/broadcast/BroadcastEvent.java b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastEvent.java similarity index 98% rename from src/audio/broadcast/BroadcastEvent.java rename to src/main/java/io/github/dsheirer/audio/broadcast/BroadcastEvent.java index f7fc4cff..802c9814 100644 --- a/src/audio/broadcast/BroadcastEvent.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastEvent.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast; +package io.github.dsheirer.audio.broadcast; public class BroadcastEvent { diff --git a/src/audio/broadcast/BroadcastFactory.java b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastFactory.java similarity index 80% rename from src/audio/broadcast/BroadcastFactory.java rename to src/main/java/io/github/dsheirer/audio/broadcast/BroadcastFactory.java index 75caef3b..85f6e43c 100644 --- a/src/audio/broadcast/BroadcastFactory.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastFactory.java @@ -16,34 +16,34 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast; +package io.github.dsheirer.audio.broadcast; -import alias.AliasModel; -import audio.broadcast.broadcastify.BroadcastifyConfiguration; -import audio.broadcast.broadcastify.BroadcastifyConfigurationEditor; -import audio.broadcast.icecast.IcecastHTTPAudioBroadcaster; -import audio.broadcast.icecast.IcecastHTTPConfiguration; -import audio.broadcast.icecast.IcecastHTTPConfigurationEditor; -import audio.broadcast.icecast.IcecastTCPAudioBroadcaster; -import audio.broadcast.icecast.IcecastTCPConfiguration; -import audio.broadcast.icecast.IcecastTCPConfigurationEditor; -import audio.broadcast.shoutcast.v1.ShoutcastV1AudioBroadcaster; -import audio.broadcast.shoutcast.v1.ShoutcastV1Configuration; -import audio.broadcast.shoutcast.v1.ShoutcastV1ConfigurationEditor; -import audio.broadcast.shoutcast.v2.ShoutcastV2AudioBroadcaster; -import audio.broadcast.shoutcast.v2.ShoutcastV2Configuration; -import audio.broadcast.shoutcast.v2.ShoutcastV2ConfigurationEditor; -import audio.convert.IAudioConverter; -import audio.convert.ISilenceGenerator; -import audio.convert.MP3AudioConverter; -import audio.convert.MP3SilenceGenerator; -import gui.editor.Editor; -import gui.editor.EmptyEditor; -import icon.IconManager; +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; +import io.github.dsheirer.audio.broadcast.icecast.IcecastHTTPConfiguration; +import io.github.dsheirer.audio.broadcast.icecast.IcecastHTTPConfigurationEditor; +import io.github.dsheirer.audio.broadcast.icecast.IcecastTCPAudioBroadcaster; +import io.github.dsheirer.audio.broadcast.icecast.IcecastTCPConfiguration; +import io.github.dsheirer.audio.broadcast.icecast.IcecastTCPConfigurationEditor; +import io.github.dsheirer.audio.broadcast.shoutcast.v1.ShoutcastV1AudioBroadcaster; +import io.github.dsheirer.audio.broadcast.shoutcast.v1.ShoutcastV1Configuration; +import io.github.dsheirer.audio.broadcast.shoutcast.v1.ShoutcastV1ConfigurationEditor; +import io.github.dsheirer.audio.broadcast.shoutcast.v2.ShoutcastV2AudioBroadcaster; +import io.github.dsheirer.audio.broadcast.shoutcast.v2.ShoutcastV2Configuration; +import io.github.dsheirer.audio.broadcast.shoutcast.v2.ShoutcastV2ConfigurationEditor; +import io.github.dsheirer.audio.convert.IAudioConverter; +import io.github.dsheirer.audio.convert.ISilenceGenerator; +import io.github.dsheirer.audio.convert.MP3AudioConverter; +import io.github.dsheirer.audio.convert.MP3SilenceGenerator; +import io.github.dsheirer.gui.editor.Editor; +import io.github.dsheirer.gui.editor.EmptyEditor; +import io.github.dsheirer.icon.IconManager; +import io.github.dsheirer.record.AudioRecorder; +import io.github.dsheirer.record.mp3.MP3Recorder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import record.AudioRecorder; -import record.mp3.MP3Recorder; import java.nio.file.Path; diff --git a/src/audio/broadcast/BroadcastFormat.java b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastFormat.java similarity index 96% rename from src/audio/broadcast/BroadcastFormat.java rename to src/main/java/io/github/dsheirer/audio/broadcast/BroadcastFormat.java index 134423bd..a02020a7 100644 --- a/src/audio/broadcast/BroadcastFormat.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastFormat.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast; +package io.github.dsheirer.audio.broadcast; public enum BroadcastFormat { diff --git a/src/audio/broadcast/BroadcastModel.java b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastModel.java similarity index 98% rename from src/audio/broadcast/BroadcastModel.java rename to src/main/java/io/github/dsheirer/audio/broadcast/BroadcastModel.java index 04f64f76..f942411b 100644 --- a/src/audio/broadcast/BroadcastModel.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastModel.java @@ -16,18 +16,18 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast; +package io.github.dsheirer.audio.broadcast; -import alias.id.broadcast.BroadcastChannel; -import audio.AudioPacket; -import channel.metadata.Metadata; -import icon.IconManager; +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; +import io.github.dsheirer.properties.SystemProperties; +import io.github.dsheirer.sample.Broadcaster; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.util.ThreadPool; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import properties.SystemProperties; -import sample.Broadcaster; -import sample.Listener; -import util.ThreadPool; import javax.swing.*; import javax.swing.table.AbstractTableModel; diff --git a/src/audio/broadcast/BroadcastPanel.java b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastPanel.java similarity index 97% rename from src/audio/broadcast/BroadcastPanel.java rename to src/main/java/io/github/dsheirer/audio/broadcast/BroadcastPanel.java index d299dac9..f1455618 100644 --- a/src/audio/broadcast/BroadcastPanel.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastPanel.java @@ -16,23 +16,20 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast; +package io.github.dsheirer.audio.broadcast; -import alias.AliasModel; import com.jidesoft.swing.JideSplitPane; -import gui.editor.Editor; -import gui.editor.EmptyEditor; -import icon.IconManager; +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 settings.SettingsManager; import javax.swing.*; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; -import javax.swing.table.DefaultTableCellRenderer; -import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; diff --git a/src/audio/broadcast/BroadcastServerType.java b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastServerType.java similarity index 97% rename from src/audio/broadcast/BroadcastServerType.java rename to src/main/java/io/github/dsheirer/audio/broadcast/BroadcastServerType.java index 4af40a1b..a4cced40 100644 --- a/src/audio/broadcast/BroadcastServerType.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastServerType.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast; +package io.github.dsheirer.audio.broadcast; public enum BroadcastServerType { diff --git a/src/audio/broadcast/BroadcastState.java b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastState.java similarity index 98% rename from src/audio/broadcast/BroadcastState.java rename to src/main/java/io/github/dsheirer/audio/broadcast/BroadcastState.java index 86470632..5fd6c3f3 100644 --- a/src/audio/broadcast/BroadcastState.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastState.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast; +package io.github.dsheirer.audio.broadcast; public enum BroadcastState { diff --git a/src/audio/broadcast/BroadcastStatusPanel.java b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastStatusPanel.java similarity index 98% rename from src/audio/broadcast/BroadcastStatusPanel.java rename to src/main/java/io/github/dsheirer/audio/broadcast/BroadcastStatusPanel.java index 34d91baf..b82e31d2 100644 --- a/src/audio/broadcast/BroadcastStatusPanel.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastStatusPanel.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast; +package io.github.dsheirer.audio.broadcast; import net.miginfocom.swing.MigLayout; diff --git a/src/audio/broadcast/IBroadcastMetadataUpdater.java b/src/main/java/io/github/dsheirer/audio/broadcast/IBroadcastMetadataUpdater.java similarity index 91% rename from src/audio/broadcast/IBroadcastMetadataUpdater.java rename to src/main/java/io/github/dsheirer/audio/broadcast/IBroadcastMetadataUpdater.java index e5f1e13f..babf86b1 100644 --- a/src/audio/broadcast/IBroadcastMetadataUpdater.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/IBroadcastMetadataUpdater.java @@ -16,9 +16,9 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast; +package io.github.dsheirer.audio.broadcast; -import channel.metadata.Metadata; +import io.github.dsheirer.channel.metadata.Metadata; public interface IBroadcastMetadataUpdater { diff --git a/src/audio/broadcast/StreamManager.java b/src/main/java/io/github/dsheirer/audio/broadcast/StreamManager.java similarity index 96% rename from src/audio/broadcast/StreamManager.java rename to src/main/java/io/github/dsheirer/audio/broadcast/StreamManager.java index 538ad5be..ce98e155 100644 --- a/src/audio/broadcast/StreamManager.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/StreamManager.java @@ -16,15 +16,15 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast; +package io.github.dsheirer.audio.broadcast; -import audio.AudioPacket; +import io.github.dsheirer.audio.AudioPacket; +import io.github.dsheirer.record.AudioRecorder; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.util.ThreadPool; +import io.github.dsheirer.util.TimeStamp; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import record.AudioRecorder; -import sample.Listener; -import util.ThreadPool; -import util.TimeStamp; import java.nio.file.Files; import java.nio.file.Path; diff --git a/src/audio/broadcast/broadcastify/BroadcastifyConfiguration.java b/src/main/java/io/github/dsheirer/audio/broadcast/broadcastify/BroadcastifyConfiguration.java similarity index 80% rename from src/audio/broadcast/broadcastify/BroadcastifyConfiguration.java rename to src/main/java/io/github/dsheirer/audio/broadcast/broadcastify/BroadcastifyConfiguration.java index bc10af3e..367592cb 100644 --- a/src/audio/broadcast/broadcastify/BroadcastifyConfiguration.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/broadcastify/BroadcastifyConfiguration.java @@ -16,14 +16,13 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.broadcastify; +package io.github.dsheirer.audio.broadcast.broadcastify; -import audio.broadcast.BroadcastConfiguration; -import audio.broadcast.BroadcastFormat; -import audio.broadcast.BroadcastServerType; -import audio.broadcast.icecast.IcecastTCPConfiguration; - -import javax.xml.bind.annotation.XmlAttribute; +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; public class BroadcastifyConfiguration extends IcecastTCPConfiguration { @@ -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; diff --git a/src/audio/broadcast/broadcastify/BroadcastifyConfigurationEditor.java b/src/main/java/io/github/dsheirer/audio/broadcast/broadcastify/BroadcastifyConfigurationEditor.java similarity index 96% rename from src/audio/broadcast/broadcastify/BroadcastifyConfigurationEditor.java rename to src/main/java/io/github/dsheirer/audio/broadcast/broadcastify/BroadcastifyConfigurationEditor.java index 45809d3d..3b74585d 100644 --- a/src/audio/broadcast/broadcastify/BroadcastifyConfigurationEditor.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/broadcastify/BroadcastifyConfigurationEditor.java @@ -16,20 +16,20 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.broadcastify; +package io.github.dsheirer.audio.broadcast.broadcastify; -import alias.AliasModel; -import audio.broadcast.BroadcastConfiguration; -import audio.broadcast.BroadcastConfigurationEditor; -import audio.broadcast.BroadcastEvent; -import audio.broadcast.BroadcastModel; -import audio.broadcast.BroadcastServerType; import com.radioreference.api.soap2.UserFeedBroadcast; -import icon.IconManager; +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; +import io.github.dsheirer.audio.broadcast.BroadcastModel; +import io.github.dsheirer.audio.broadcast.BroadcastServerType; +import io.github.dsheirer.icon.IconManager; +import io.github.dsheirer.sample.Listener; import net.miginfocom.swing.MigLayout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; import javax.swing.*; import javax.swing.event.ChangeEvent; diff --git a/src/audio/broadcast/broadcastify/UserFeedSelectionDialog.java b/src/main/java/io/github/dsheirer/audio/broadcast/broadcastify/UserFeedSelectionDialog.java similarity index 98% rename from src/audio/broadcast/broadcastify/UserFeedSelectionDialog.java rename to src/main/java/io/github/dsheirer/audio/broadcast/broadcastify/UserFeedSelectionDialog.java index d9fb63e3..566ecc30 100644 --- a/src/audio/broadcast/broadcastify/UserFeedSelectionDialog.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/broadcastify/UserFeedSelectionDialog.java @@ -16,14 +16,14 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.broadcastify; +package io.github.dsheirer.audio.broadcast.broadcastify; import com.radioreference.api.soap2.UserFeedBroadcast; -import external.radioreference.RadioReferenceService; +import io.github.dsheirer.radioreference.RadioReferenceService; +import io.github.dsheirer.sample.Listener; import net.miginfocom.swing.MigLayout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; import javax.swing.*; import javax.swing.event.DocumentEvent; diff --git a/src/audio/broadcast/icecast/IcecastAudioBroadcaster.java b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastAudioBroadcaster.java similarity index 86% rename from src/audio/broadcast/icecast/IcecastAudioBroadcaster.java rename to src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastAudioBroadcaster.java index 60b6f1b2..87bc5dae 100644 --- a/src/audio/broadcast/icecast/IcecastAudioBroadcaster.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastAudioBroadcaster.java @@ -16,11 +16,11 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.icecast; +package io.github.dsheirer.audio.broadcast.icecast; -import audio.broadcast.AudioBroadcaster; -import audio.broadcast.BroadcastConfiguration; -import audio.broadcast.IBroadcastMetadataUpdater; +import io.github.dsheirer.audio.broadcast.AudioBroadcaster; +import io.github.dsheirer.audio.broadcast.BroadcastConfiguration; +import io.github.dsheirer.audio.broadcast.IBroadcastMetadataUpdater; public abstract class IcecastAudioBroadcaster extends AudioBroadcaster { diff --git a/src/audio/broadcast/icecast/IcecastBroadcastMetadataUpdater.java b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastBroadcastMetadataUpdater.java similarity index 97% rename from src/audio/broadcast/icecast/IcecastBroadcastMetadataUpdater.java rename to src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastBroadcastMetadataUpdater.java index 146c200d..1bd767f8 100644 --- a/src/audio/broadcast/icecast/IcecastBroadcastMetadataUpdater.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastBroadcastMetadataUpdater.java @@ -16,10 +16,12 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.icecast; +package io.github.dsheirer.audio.broadcast.icecast; -import audio.broadcast.IBroadcastMetadataUpdater; -import channel.metadata.Metadata; +import io.github.dsheirer.audio.broadcast.IBroadcastMetadataUpdater; +import io.github.dsheirer.channel.metadata.Metadata; +import io.github.dsheirer.properties.SystemProperties; +import io.github.dsheirer.util.ThreadPool; import org.apache.mina.core.future.ConnectFuture; import org.apache.mina.core.service.IoHandlerAdapter; import org.apache.mina.core.session.IoSession; @@ -31,8 +33,6 @@ import org.apache.mina.http.api.HttpVersion; import org.apache.mina.transport.socket.nio.NioSocketConnector; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import properties.SystemProperties; -import util.ThreadPool; import java.io.UnsupportedEncodingException; import java.net.ConnectException; diff --git a/src/audio/broadcast/icecast/IcecastConfiguration.java b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastConfiguration.java similarity index 80% rename from src/audio/broadcast/icecast/IcecastConfiguration.java rename to src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastConfiguration.java index e70f6075..682dc7ed 100644 --- a/src/audio/broadcast/icecast/IcecastConfiguration.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastConfiguration.java @@ -16,15 +16,22 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.icecast; +package io.github.dsheirer.audio.broadcast.icecast; -import audio.broadcast.BroadcastConfiguration; -import audio.broadcast.BroadcastFormat; +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) diff --git a/src/audio/broadcast/icecast/IcecastHTTPAudioBroadcaster.java b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastHTTPAudioBroadcaster.java similarity index 97% rename from src/audio/broadcast/icecast/IcecastHTTPAudioBroadcaster.java rename to src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastHTTPAudioBroadcaster.java index 935d4979..3655dc20 100644 --- a/src/audio/broadcast/icecast/IcecastHTTPAudioBroadcaster.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastHTTPAudioBroadcaster.java @@ -16,10 +16,12 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.icecast; +package io.github.dsheirer.audio.broadcast.icecast; -import audio.broadcast.BroadcastState; -import audio.convert.MP3AudioConverter; +import io.github.dsheirer.audio.broadcast.BroadcastState; +import io.github.dsheirer.audio.convert.MP3AudioConverter; +import io.github.dsheirer.properties.SystemProperties; +import io.github.dsheirer.util.ThreadPool; import org.apache.mina.core.RuntimeIoException; import org.apache.mina.core.buffer.IoBuffer; import org.apache.mina.core.future.ConnectFuture; @@ -36,8 +38,6 @@ import org.apache.mina.http.api.HttpVersion; import org.apache.mina.transport.socket.nio.NioSocketConnector; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import properties.SystemProperties; -import util.ThreadPool; import java.net.ConnectException; import java.net.InetSocketAddress; diff --git a/src/audio/broadcast/icecast/IcecastHTTPConfiguration.java b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastHTTPConfiguration.java similarity index 79% rename from src/audio/broadcast/icecast/IcecastHTTPConfiguration.java rename to src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastHTTPConfiguration.java index ee0be59b..b4b1f99a 100644 --- a/src/audio/broadcast/icecast/IcecastHTTPConfiguration.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastHTTPConfiguration.java @@ -16,14 +16,15 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.icecast; +package io.github.dsheirer.audio.broadcast.icecast; -import audio.broadcast.BroadcastConfiguration; -import audio.broadcast.BroadcastFormat; -import audio.broadcast.BroadcastServerType; - -import java.util.Base64; +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() @@ -68,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; } - - } diff --git a/src/audio/broadcast/icecast/IcecastHTTPConfigurationEditor.java b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastHTTPConfigurationEditor.java similarity index 96% rename from src/audio/broadcast/icecast/IcecastHTTPConfigurationEditor.java rename to src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastHTTPConfigurationEditor.java index 4bd58ff5..399e6096 100644 --- a/src/audio/broadcast/icecast/IcecastHTTPConfigurationEditor.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastHTTPConfigurationEditor.java @@ -16,19 +16,18 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.icecast; +package io.github.dsheirer.audio.broadcast.icecast; -import alias.AliasModel; -import audio.broadcast.BroadcastConfiguration; -import audio.broadcast.BroadcastConfigurationEditor; -import audio.broadcast.BroadcastEvent; -import audio.broadcast.BroadcastModel; -import audio.broadcast.BroadcastServerType; -import icon.IconManager; +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; +import io.github.dsheirer.audio.broadcast.BroadcastModel; +import io.github.dsheirer.audio.broadcast.BroadcastServerType; +import io.github.dsheirer.icon.IconManager; import net.miginfocom.swing.MigLayout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import settings.SettingsManager; import javax.swing.*; import javax.swing.event.ChangeEvent; diff --git a/src/audio/broadcast/icecast/IcecastHeader.java b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastHeader.java similarity index 96% rename from src/audio/broadcast/icecast/IcecastHeader.java rename to src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastHeader.java index b9cd07c7..8d6275f8 100644 --- a/src/audio/broadcast/icecast/IcecastHeader.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastHeader.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.icecast; +package io.github.dsheirer.audio.broadcast.icecast; public enum IcecastHeader { diff --git a/src/audio/broadcast/icecast/IcecastTCPAudioBroadcaster.java b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastTCPAudioBroadcaster.java similarity index 97% rename from src/audio/broadcast/icecast/IcecastTCPAudioBroadcaster.java rename to src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastTCPAudioBroadcaster.java index 3d03e295..dc586f1f 100644 --- a/src/audio/broadcast/icecast/IcecastTCPAudioBroadcaster.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastTCPAudioBroadcaster.java @@ -16,11 +16,13 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.icecast; +package io.github.dsheirer.audio.broadcast.icecast; -import audio.broadcast.BroadcastState; -import audio.broadcast.icecast.codec.IcecastCodecFactory; -import audio.convert.MP3AudioConverter; +import io.github.dsheirer.audio.broadcast.BroadcastState; +import io.github.dsheirer.audio.broadcast.icecast.codec.IcecastCodecFactory; +import io.github.dsheirer.audio.convert.MP3AudioConverter; +import io.github.dsheirer.properties.SystemProperties; +import io.github.dsheirer.util.ThreadPool; import org.apache.mina.core.RuntimeIoException; import org.apache.mina.core.future.ConnectFuture; import org.apache.mina.core.service.IoHandlerAdapter; @@ -30,8 +32,6 @@ import org.apache.mina.filter.codec.ProtocolCodecFilter; import org.apache.mina.transport.socket.nio.NioSocketConnector; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import properties.SystemProperties; -import util.ThreadPool; import java.io.IOException; import java.net.ConnectException; diff --git a/src/audio/broadcast/icecast/IcecastTCPConfiguration.java b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastTCPConfiguration.java similarity index 72% rename from src/audio/broadcast/icecast/IcecastTCPConfiguration.java rename to src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastTCPConfiguration.java index 413f0a32..c735265e 100644 --- a/src/audio/broadcast/icecast/IcecastTCPConfiguration.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastTCPConfiguration.java @@ -16,18 +16,22 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.icecast; +package io.github.dsheirer.audio.broadcast.icecast; -import audio.broadcast.BroadcastConfiguration; -import audio.broadcast.BroadcastFormat; -import audio.broadcast.BroadcastServerType; -import audio.broadcast.broadcastify.BroadcastifyConfiguration; +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; +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() { diff --git a/src/audio/broadcast/icecast/IcecastTCPConfigurationEditor.java b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastTCPConfigurationEditor.java similarity index 96% rename from src/audio/broadcast/icecast/IcecastTCPConfigurationEditor.java rename to src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastTCPConfigurationEditor.java index 0fe7e20c..4223a0d9 100644 --- a/src/audio/broadcast/icecast/IcecastTCPConfigurationEditor.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastTCPConfigurationEditor.java @@ -16,19 +16,18 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.icecast; +package io.github.dsheirer.audio.broadcast.icecast; -import alias.AliasModel; -import audio.broadcast.BroadcastConfiguration; -import audio.broadcast.BroadcastConfigurationEditor; -import audio.broadcast.BroadcastEvent; -import audio.broadcast.BroadcastModel; -import audio.broadcast.BroadcastServerType; -import icon.IconManager; +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; +import io.github.dsheirer.audio.broadcast.BroadcastModel; +import io.github.dsheirer.audio.broadcast.BroadcastServerType; +import io.github.dsheirer.icon.IconManager; import net.miginfocom.swing.MigLayout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import settings.SettingsManager; import javax.swing.*; import javax.swing.event.ChangeEvent; diff --git a/src/audio/broadcast/icecast/codec/IcecastCodecFactory.java b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/codec/IcecastCodecFactory.java similarity index 97% rename from src/audio/broadcast/icecast/codec/IcecastCodecFactory.java rename to src/main/java/io/github/dsheirer/audio/broadcast/icecast/codec/IcecastCodecFactory.java index fef72ba8..a685da02 100644 --- a/src/audio/broadcast/icecast/codec/IcecastCodecFactory.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/codec/IcecastCodecFactory.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.icecast.codec; +package io.github.dsheirer.audio.broadcast.icecast.codec; import org.apache.mina.core.session.IoSession; import org.apache.mina.filter.codec.ProtocolCodecFactory; diff --git a/src/audio/broadcast/icecast/codec/IcecastEncoder.java b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/codec/IcecastEncoder.java similarity index 98% rename from src/audio/broadcast/icecast/codec/IcecastEncoder.java rename to src/main/java/io/github/dsheirer/audio/broadcast/icecast/codec/IcecastEncoder.java index 565b478d..b63d8e35 100644 --- a/src/audio/broadcast/icecast/codec/IcecastEncoder.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/codec/IcecastEncoder.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.icecast.codec; +package io.github.dsheirer.audio.broadcast.icecast.codec; import org.apache.mina.core.buffer.IoBuffer; import org.apache.mina.core.session.AttributeKey; diff --git a/src/audio/broadcast/shoutcast/v1/ShoutcastMetadata.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v1/ShoutcastMetadata.java similarity index 96% rename from src/audio/broadcast/shoutcast/v1/ShoutcastMetadata.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v1/ShoutcastMetadata.java index b62eb032..ed41a6f9 100644 --- a/src/audio/broadcast/shoutcast/v1/ShoutcastMetadata.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v1/ShoutcastMetadata.java @@ -16,9 +16,9 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v1; +package io.github.dsheirer.audio.broadcast.shoutcast.v1; -import audio.broadcast.BroadcastFormat; +import io.github.dsheirer.audio.broadcast.BroadcastFormat; public enum ShoutcastMetadata { diff --git a/src/audio/broadcast/shoutcast/v1/ShoutcastV1AudioBroadcaster.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v1/ShoutcastV1AudioBroadcaster.java similarity index 97% rename from src/audio/broadcast/shoutcast/v1/ShoutcastV1AudioBroadcaster.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v1/ShoutcastV1AudioBroadcaster.java index e1afae65..7dea307a 100644 --- a/src/audio/broadcast/shoutcast/v1/ShoutcastV1AudioBroadcaster.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v1/ShoutcastV1AudioBroadcaster.java @@ -16,11 +16,12 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v1; +package io.github.dsheirer.audio.broadcast.shoutcast.v1; -import audio.broadcast.AudioBroadcaster; -import audio.broadcast.BroadcastState; -import audio.broadcast.IBroadcastMetadataUpdater; +import io.github.dsheirer.audio.broadcast.AudioBroadcaster; +import io.github.dsheirer.audio.broadcast.BroadcastState; +import io.github.dsheirer.audio.broadcast.IBroadcastMetadataUpdater; +import io.github.dsheirer.util.ThreadPool; import org.apache.mina.core.RuntimeIoException; import org.apache.mina.core.buffer.IoBuffer; import org.apache.mina.core.future.ConnectFuture; @@ -31,7 +32,6 @@ import org.apache.mina.filter.codec.textline.TextLineCodecFactory; import org.apache.mina.transport.socket.nio.NioSocketConnector; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import util.ThreadPool; import java.io.IOException; import java.net.ConnectException; diff --git a/src/audio/broadcast/shoutcast/v1/ShoutcastV1BroadcastMetadataUpdater.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v1/ShoutcastV1BroadcastMetadataUpdater.java similarity index 97% rename from src/audio/broadcast/shoutcast/v1/ShoutcastV1BroadcastMetadataUpdater.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v1/ShoutcastV1BroadcastMetadataUpdater.java index 6ef77c33..faf672d1 100644 --- a/src/audio/broadcast/shoutcast/v1/ShoutcastV1BroadcastMetadataUpdater.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v1/ShoutcastV1BroadcastMetadataUpdater.java @@ -16,10 +16,11 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v1; +package io.github.dsheirer.audio.broadcast.shoutcast.v1; -import audio.broadcast.IBroadcastMetadataUpdater; -import channel.metadata.Metadata; +import io.github.dsheirer.audio.broadcast.IBroadcastMetadataUpdater; +import io.github.dsheirer.channel.metadata.Metadata; +import io.github.dsheirer.util.ThreadPool; import org.apache.mina.core.future.ConnectFuture; import org.apache.mina.core.service.IoHandlerAdapter; import org.apache.mina.core.session.IoSession; @@ -31,7 +32,6 @@ import org.apache.mina.http.api.HttpVersion; import org.apache.mina.transport.socket.nio.NioSocketConnector; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import util.ThreadPool; import java.io.UnsupportedEncodingException; import java.net.ConnectException; diff --git a/src/audio/broadcast/shoutcast/v1/ShoutcastV1Configuration.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v1/ShoutcastV1Configuration.java similarity index 80% rename from src/audio/broadcast/shoutcast/v1/ShoutcastV1Configuration.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v1/ShoutcastV1Configuration.java index ee1133fa..db8c0dc3 100644 --- a/src/audio/broadcast/shoutcast/v1/ShoutcastV1Configuration.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v1/ShoutcastV1Configuration.java @@ -16,13 +16,12 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v1; +package io.github.dsheirer.audio.broadcast.shoutcast.v1; -import audio.broadcast.BroadcastConfiguration; -import audio.broadcast.BroadcastFormat; -import audio.broadcast.BroadcastServerType; - -import javax.xml.bind.annotation.XmlAttribute; +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; public class ShoutcastV1Configuration extends BroadcastConfiguration { @@ -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(); } } diff --git a/src/audio/broadcast/shoutcast/v1/ShoutcastV1ConfigurationEditor.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v1/ShoutcastV1ConfigurationEditor.java similarity index 96% rename from src/audio/broadcast/shoutcast/v1/ShoutcastV1ConfigurationEditor.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v1/ShoutcastV1ConfigurationEditor.java index 256e846f..79f0a0e4 100644 --- a/src/audio/broadcast/shoutcast/v1/ShoutcastV1ConfigurationEditor.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v1/ShoutcastV1ConfigurationEditor.java @@ -16,15 +16,15 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v1; +package io.github.dsheirer.audio.broadcast.shoutcast.v1; -import alias.AliasModel; -import audio.broadcast.BroadcastConfiguration; -import audio.broadcast.BroadcastConfigurationEditor; -import audio.broadcast.BroadcastEvent; -import audio.broadcast.BroadcastModel; -import audio.broadcast.BroadcastServerType; -import icon.IconManager; +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; +import io.github.dsheirer.audio.broadcast.BroadcastModel; +import io.github.dsheirer.audio.broadcast.BroadcastServerType; +import io.github.dsheirer.icon.IconManager; import net.miginfocom.swing.MigLayout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/audio/broadcast/shoutcast/v2/ShoutcastV2AudioBroadcaster.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ShoutcastV2AudioBroadcaster.java similarity index 92% rename from src/audio/broadcast/shoutcast/v2/ShoutcastV2AudioBroadcaster.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ShoutcastV2AudioBroadcaster.java index 034666e4..b0d3c377 100644 --- a/src/audio/broadcast/shoutcast/v2/ShoutcastV2AudioBroadcaster.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ShoutcastV2AudioBroadcaster.java @@ -16,28 +16,29 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v2; +package io.github.dsheirer.audio.broadcast.shoutcast.v2; -import audio.broadcast.AudioBroadcaster; -import audio.broadcast.BroadcastState; -import audio.broadcast.IBroadcastMetadataUpdater; -import audio.broadcast.shoutcast.v2.ultravox.AuthenticateBroadcast; -import audio.broadcast.shoutcast.v2.ultravox.CacheableXMLMetadata; -import audio.broadcast.shoutcast.v2.ultravox.ConfigureIcyName; -import audio.broadcast.shoutcast.v2.ultravox.ConfigureIcyPublic; -import audio.broadcast.shoutcast.v2.ultravox.MP3Audio; -import audio.broadcast.shoutcast.v2.ultravox.NegotiateMaxPayloadSize; -import audio.broadcast.shoutcast.v2.ultravox.RequestCipher; -import audio.broadcast.shoutcast.v2.ultravox.SetupBroadcast; -import audio.broadcast.shoutcast.v2.ultravox.Standby; -import audio.broadcast.shoutcast.v2.ultravox.StreamMimeType; -import audio.broadcast.shoutcast.v2.ultravox.TerminateBroadcast; -import audio.broadcast.shoutcast.v2.ultravox.UltravoxMessage; -import audio.broadcast.shoutcast.v2.ultravox.UltravoxMessageFactory; -import audio.broadcast.shoutcast.v2.ultravox.UltravoxMessageType; -import audio.broadcast.shoutcast.v2.ultravox.UltravoxMetadata; -import audio.broadcast.shoutcast.v2.ultravox.UltravoxProtocolFactory; -import channel.metadata.Metadata; +import io.github.dsheirer.audio.broadcast.AudioBroadcaster; +import io.github.dsheirer.audio.broadcast.BroadcastState; +import io.github.dsheirer.audio.broadcast.IBroadcastMetadataUpdater; +import io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox.AuthenticateBroadcast; +import io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox.CacheableXMLMetadata; +import io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox.ConfigureIcyName; +import io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox.ConfigureIcyPublic; +import io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox.MP3Audio; +import io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox.NegotiateMaxPayloadSize; +import io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox.RequestCipher; +import io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox.SetupBroadcast; +import io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox.Standby; +import io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox.StreamMimeType; +import io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox.UltravoxMessage; +import io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox.UltravoxMessageFactory; +import io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox.UltravoxMessageType; +import io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox.UltravoxMetadata; +import io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox.UltravoxProtocolFactory; +import io.github.dsheirer.channel.metadata.Metadata; +import io.github.dsheirer.properties.SystemProperties; +import io.github.dsheirer.util.ThreadPool; import org.apache.mina.core.RuntimeIoException; import org.apache.mina.core.future.ConnectFuture; import org.apache.mina.core.service.IoHandlerAdapter; @@ -46,8 +47,6 @@ import org.apache.mina.filter.codec.ProtocolCodecFilter; import org.apache.mina.transport.socket.nio.NioSocketConnector; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import properties.SystemProperties; -import util.ThreadPool; import java.io.IOException; import java.io.UnsupportedEncodingException; diff --git a/src/audio/broadcast/shoutcast/v2/ShoutcastV2Configuration.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ShoutcastV2Configuration.java similarity index 85% rename from src/audio/broadcast/shoutcast/v2/ShoutcastV2Configuration.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ShoutcastV2Configuration.java index b3ba1212..d4fa7f06 100644 --- a/src/audio/broadcast/shoutcast/v2/ShoutcastV2Configuration.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ShoutcastV2Configuration.java @@ -16,15 +16,14 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v2; +package io.github.dsheirer.audio.broadcast.shoutcast.v2; -import audio.broadcast.BroadcastConfiguration; -import audio.broadcast.BroadcastFormat; -import audio.broadcast.BroadcastServerType; +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) diff --git a/src/audio/broadcast/shoutcast/v2/ShoutcastV2ConfigurationEditor.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ShoutcastV2ConfigurationEditor.java similarity index 96% rename from src/audio/broadcast/shoutcast/v2/ShoutcastV2ConfigurationEditor.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ShoutcastV2ConfigurationEditor.java index 083ccc07..ee8637eb 100644 --- a/src/audio/broadcast/shoutcast/v2/ShoutcastV2ConfigurationEditor.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ShoutcastV2ConfigurationEditor.java @@ -16,15 +16,15 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v2; +package io.github.dsheirer.audio.broadcast.shoutcast.v2; -import alias.AliasModel; -import audio.broadcast.BroadcastConfiguration; -import audio.broadcast.BroadcastConfigurationEditor; -import audio.broadcast.BroadcastEvent; -import audio.broadcast.BroadcastModel; -import audio.broadcast.BroadcastServerType; -import icon.IconManager; +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; +import io.github.dsheirer.audio.broadcast.BroadcastModel; +import io.github.dsheirer.audio.broadcast.BroadcastServerType; +import io.github.dsheirer.icon.IconManager; import net.miginfocom.swing.MigLayout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/audio/broadcast/shoutcast/v2/ultravox/AuthenticateBroadcast.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/AuthenticateBroadcast.java similarity index 97% rename from src/audio/broadcast/shoutcast/v2/ultravox/AuthenticateBroadcast.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/AuthenticateBroadcast.java index b55e4b05..1731ec60 100644 --- a/src/audio/broadcast/shoutcast/v2/ultravox/AuthenticateBroadcast.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/AuthenticateBroadcast.java @@ -16,9 +16,9 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v2.ultravox; +package io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox; -import util.XTEA; +import io.github.dsheirer.util.XTEA; import java.util.Arrays; diff --git a/src/audio/broadcast/shoutcast/v2/ultravox/CacheableXMLMetadata.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/CacheableXMLMetadata.java similarity index 95% rename from src/audio/broadcast/shoutcast/v2/ultravox/CacheableXMLMetadata.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/CacheableXMLMetadata.java index 06c35560..a47e0500 100644 --- a/src/audio/broadcast/shoutcast/v2/ultravox/CacheableXMLMetadata.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/CacheableXMLMetadata.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v2.ultravox; +package io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox; public class CacheableXMLMetadata extends UltravoxMessage { diff --git a/src/audio/broadcast/shoutcast/v2/ultravox/ConfigureIcyGenre.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/ConfigureIcyGenre.java similarity index 95% rename from src/audio/broadcast/shoutcast/v2/ultravox/ConfigureIcyGenre.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/ConfigureIcyGenre.java index 917b0a67..5a84f13a 100644 --- a/src/audio/broadcast/shoutcast/v2/ultravox/ConfigureIcyGenre.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/ConfigureIcyGenre.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v2.ultravox; +package io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox; public class ConfigureIcyGenre extends UltravoxMessage { diff --git a/src/audio/broadcast/shoutcast/v2/ultravox/ConfigureIcyName.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/ConfigureIcyName.java similarity index 95% rename from src/audio/broadcast/shoutcast/v2/ultravox/ConfigureIcyName.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/ConfigureIcyName.java index 8ee981af..af7b677e 100644 --- a/src/audio/broadcast/shoutcast/v2/ultravox/ConfigureIcyName.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/ConfigureIcyName.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v2.ultravox; +package io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox; public class ConfigureIcyName extends UltravoxMessage { diff --git a/src/audio/broadcast/shoutcast/v2/ultravox/ConfigureIcyPublic.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/ConfigureIcyPublic.java similarity index 95% rename from src/audio/broadcast/shoutcast/v2/ultravox/ConfigureIcyPublic.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/ConfigureIcyPublic.java index d86f0e65..541f8be1 100644 --- a/src/audio/broadcast/shoutcast/v2/ultravox/ConfigureIcyPublic.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/ConfigureIcyPublic.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v2.ultravox; +package io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox; public class ConfigureIcyPublic extends UltravoxMessage { diff --git a/src/audio/broadcast/shoutcast/v2/ultravox/ConfigureIcyURL.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/ConfigureIcyURL.java similarity index 95% rename from src/audio/broadcast/shoutcast/v2/ultravox/ConfigureIcyURL.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/ConfigureIcyURL.java index b05d44f5..428c6a5b 100644 --- a/src/audio/broadcast/shoutcast/v2/ultravox/ConfigureIcyURL.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/ConfigureIcyURL.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v2.ultravox; +package io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox; public class ConfigureIcyURL extends UltravoxMessage { diff --git a/src/audio/broadcast/shoutcast/v2/ultravox/FlushCachedMetadata.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/FlushCachedMetadata.java similarity index 95% rename from src/audio/broadcast/shoutcast/v2/ultravox/FlushCachedMetadata.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/FlushCachedMetadata.java index 245279e5..38690f1b 100644 --- a/src/audio/broadcast/shoutcast/v2/ultravox/FlushCachedMetadata.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/FlushCachedMetadata.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v2.ultravox; +package io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox; public class FlushCachedMetadata extends UltravoxMessage { diff --git a/src/audio/broadcast/shoutcast/v2/ultravox/MP3Audio.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/MP3Audio.java similarity index 95% rename from src/audio/broadcast/shoutcast/v2/ultravox/MP3Audio.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/MP3Audio.java index f59d5ce9..eeb9d47d 100644 --- a/src/audio/broadcast/shoutcast/v2/ultravox/MP3Audio.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/MP3Audio.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v2.ultravox; +package io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox; public class MP3Audio extends UltravoxMessage { diff --git a/src/audio/broadcast/shoutcast/v2/ultravox/NegotiateBufferSize.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/NegotiateBufferSize.java similarity index 97% rename from src/audio/broadcast/shoutcast/v2/ultravox/NegotiateBufferSize.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/NegotiateBufferSize.java index 05e53544..92dcb6f4 100644 --- a/src/audio/broadcast/shoutcast/v2/ultravox/NegotiateBufferSize.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/NegotiateBufferSize.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v2.ultravox; +package io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox; public class NegotiateBufferSize extends UltravoxMessage { diff --git a/src/audio/broadcast/shoutcast/v2/ultravox/NegotiateMaxPayloadSize.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/NegotiateMaxPayloadSize.java similarity index 97% rename from src/audio/broadcast/shoutcast/v2/ultravox/NegotiateMaxPayloadSize.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/NegotiateMaxPayloadSize.java index 1c7cf728..c64dd9a0 100644 --- a/src/audio/broadcast/shoutcast/v2/ultravox/NegotiateMaxPayloadSize.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/NegotiateMaxPayloadSize.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v2.ultravox; +package io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox; import org.apache.commons.lang3.Validate; diff --git a/src/audio/broadcast/shoutcast/v2/ultravox/PassThroughXMLMetadata.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/PassThroughXMLMetadata.java similarity index 95% rename from src/audio/broadcast/shoutcast/v2/ultravox/PassThroughXMLMetadata.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/PassThroughXMLMetadata.java index 9f33f82f..d1a9eeeb 100644 --- a/src/audio/broadcast/shoutcast/v2/ultravox/PassThroughXMLMetadata.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/PassThroughXMLMetadata.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v2.ultravox; +package io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox; public class PassThroughXMLMetadata extends UltravoxMessage { diff --git a/src/audio/broadcast/shoutcast/v2/ultravox/RequestCipher.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/RequestCipher.java similarity index 96% rename from src/audio/broadcast/shoutcast/v2/ultravox/RequestCipher.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/RequestCipher.java index 4bd2aa11..36eb7d65 100644 --- a/src/audio/broadcast/shoutcast/v2/ultravox/RequestCipher.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/RequestCipher.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v2.ultravox; +package io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox; public class RequestCipher extends UltravoxMessage { diff --git a/src/audio/broadcast/shoutcast/v2/ultravox/SetupBroadcast.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/SetupBroadcast.java similarity index 96% rename from src/audio/broadcast/shoutcast/v2/ultravox/SetupBroadcast.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/SetupBroadcast.java index 59a5fe0c..088002bf 100644 --- a/src/audio/broadcast/shoutcast/v2/ultravox/SetupBroadcast.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/SetupBroadcast.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v2.ultravox; +package io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox; public class SetupBroadcast extends UltravoxMessage { diff --git a/src/audio/broadcast/shoutcast/v2/ultravox/Standby.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/Standby.java similarity index 95% rename from src/audio/broadcast/shoutcast/v2/ultravox/Standby.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/Standby.java index b571f976..48af6754 100644 --- a/src/audio/broadcast/shoutcast/v2/ultravox/Standby.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/Standby.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v2.ultravox; +package io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox; public class Standby extends UltravoxMessage { diff --git a/src/audio/broadcast/shoutcast/v2/ultravox/StreamMimeType.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/StreamMimeType.java similarity index 92% rename from src/audio/broadcast/shoutcast/v2/ultravox/StreamMimeType.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/StreamMimeType.java index 86a65aaf..d963b1ed 100644 --- a/src/audio/broadcast/shoutcast/v2/ultravox/StreamMimeType.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/StreamMimeType.java @@ -16,9 +16,9 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v2.ultravox; +package io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox; -import audio.broadcast.BroadcastFormat; +import io.github.dsheirer.audio.broadcast.BroadcastFormat; public class StreamMimeType extends UltravoxMessage { diff --git a/src/audio/broadcast/shoutcast/v2/ultravox/TerminateBroadcast.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/TerminateBroadcast.java similarity index 95% rename from src/audio/broadcast/shoutcast/v2/ultravox/TerminateBroadcast.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/TerminateBroadcast.java index 9a5adccd..986036ed 100644 --- a/src/audio/broadcast/shoutcast/v2/ultravox/TerminateBroadcast.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/TerminateBroadcast.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v2.ultravox; +package io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox; public class TerminateBroadcast extends UltravoxMessage { diff --git a/src/audio/broadcast/shoutcast/v2/ultravox/UltravoxDecoder.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/UltravoxDecoder.java similarity index 96% rename from src/audio/broadcast/shoutcast/v2/ultravox/UltravoxDecoder.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/UltravoxDecoder.java index b46efe84..fb6a14f5 100644 --- a/src/audio/broadcast/shoutcast/v2/ultravox/UltravoxDecoder.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/UltravoxDecoder.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v2.ultravox; +package io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox; import org.apache.mina.core.buffer.IoBuffer; import org.apache.mina.core.session.IoSession; diff --git a/src/audio/broadcast/shoutcast/v2/ultravox/UltravoxEncoder.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/UltravoxEncoder.java similarity index 95% rename from src/audio/broadcast/shoutcast/v2/ultravox/UltravoxEncoder.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/UltravoxEncoder.java index bd43e8d2..e85cc72b 100644 --- a/src/audio/broadcast/shoutcast/v2/ultravox/UltravoxEncoder.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/UltravoxEncoder.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v2.ultravox; +package io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox; import org.apache.mina.core.buffer.IoBuffer; import org.apache.mina.core.session.IoSession; diff --git a/src/audio/broadcast/shoutcast/v2/ultravox/UltravoxMessage.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/UltravoxMessage.java similarity index 98% rename from src/audio/broadcast/shoutcast/v2/ultravox/UltravoxMessage.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/UltravoxMessage.java index 99180df8..59561de4 100644 --- a/src/audio/broadcast/shoutcast/v2/ultravox/UltravoxMessage.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/UltravoxMessage.java @@ -16,9 +16,9 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v2.ultravox; +package io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox; -import bits.BinaryMessage; +import io.github.dsheirer.bits.BinaryMessage; import org.apache.commons.lang3.Validate; import java.util.Arrays; diff --git a/src/audio/broadcast/shoutcast/v2/ultravox/UltravoxMessageClass.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/UltravoxMessageClass.java similarity index 96% rename from src/audio/broadcast/shoutcast/v2/ultravox/UltravoxMessageClass.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/UltravoxMessageClass.java index 08d3b35f..7e2cda3d 100644 --- a/src/audio/broadcast/shoutcast/v2/ultravox/UltravoxMessageClass.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/UltravoxMessageClass.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v2.ultravox; +package io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox; public enum UltravoxMessageClass { diff --git a/src/audio/broadcast/shoutcast/v2/ultravox/UltravoxMessageFactory.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/UltravoxMessageFactory.java similarity index 98% rename from src/audio/broadcast/shoutcast/v2/ultravox/UltravoxMessageFactory.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/UltravoxMessageFactory.java index 9423f912..6f6603e7 100644 --- a/src/audio/broadcast/shoutcast/v2/ultravox/UltravoxMessageFactory.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/UltravoxMessageFactory.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v2.ultravox; +package io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox; public class UltravoxMessageFactory { diff --git a/src/audio/broadcast/shoutcast/v2/ultravox/UltravoxMessageType.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/UltravoxMessageType.java similarity index 97% rename from src/audio/broadcast/shoutcast/v2/ultravox/UltravoxMessageType.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/UltravoxMessageType.java index a5836cc3..699b8d5c 100644 --- a/src/audio/broadcast/shoutcast/v2/ultravox/UltravoxMessageType.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/UltravoxMessageType.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v2.ultravox; +package io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox; public enum UltravoxMessageType { diff --git a/src/audio/broadcast/shoutcast/v2/ultravox/UltravoxMetadata.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/UltravoxMetadata.java similarity index 96% rename from src/audio/broadcast/shoutcast/v2/ultravox/UltravoxMetadata.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/UltravoxMetadata.java index 0372fc6b..b1c06593 100644 --- a/src/audio/broadcast/shoutcast/v2/ultravox/UltravoxMetadata.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/UltravoxMetadata.java @@ -16,10 +16,9 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v2.ultravox; +package io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox; import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; public enum UltravoxMetadata { diff --git a/src/audio/broadcast/shoutcast/v2/ultravox/UltravoxProtocolFactory.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/UltravoxProtocolFactory.java similarity index 96% rename from src/audio/broadcast/shoutcast/v2/ultravox/UltravoxProtocolFactory.java rename to src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/UltravoxProtocolFactory.java index 8aff45b9..32e56fe8 100644 --- a/src/audio/broadcast/shoutcast/v2/ultravox/UltravoxProtocolFactory.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ultravox/UltravoxProtocolFactory.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.broadcast.shoutcast.v2.ultravox; +package io.github.dsheirer.audio.broadcast.shoutcast.v2.ultravox; import org.apache.mina.core.session.IoSession; import org.apache.mina.filter.codec.ProtocolCodecFactory; diff --git a/src/audio/convert/IAudioConverter.java b/src/main/java/io/github/dsheirer/audio/convert/IAudioConverter.java similarity index 93% rename from src/audio/convert/IAudioConverter.java rename to src/main/java/io/github/dsheirer/audio/convert/IAudioConverter.java index 92ccb5dc..fd738f13 100644 --- a/src/audio/convert/IAudioConverter.java +++ b/src/main/java/io/github/dsheirer/audio/convert/IAudioConverter.java @@ -16,9 +16,9 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.convert; +package io.github.dsheirer.audio.convert; -import audio.AudioPacket; +import io.github.dsheirer.audio.AudioPacket; import java.util.List; diff --git a/src/audio/convert/ISilenceGenerator.java b/src/main/java/io/github/dsheirer/audio/convert/ISilenceGenerator.java similarity index 95% rename from src/audio/convert/ISilenceGenerator.java rename to src/main/java/io/github/dsheirer/audio/convert/ISilenceGenerator.java index ac2e1c5c..42682944 100644 --- a/src/audio/convert/ISilenceGenerator.java +++ b/src/main/java/io/github/dsheirer/audio/convert/ISilenceGenerator.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.convert; +package io.github.dsheirer.audio.convert; public interface ISilenceGenerator { diff --git a/src/audio/convert/MP3AudioConverter.java b/src/main/java/io/github/dsheirer/audio/convert/MP3AudioConverter.java similarity index 94% rename from src/audio/convert/MP3AudioConverter.java rename to src/main/java/io/github/dsheirer/audio/convert/MP3AudioConverter.java index ea813f1c..1a8c86cb 100644 --- a/src/audio/convert/MP3AudioConverter.java +++ b/src/main/java/io/github/dsheirer/audio/convert/MP3AudioConverter.java @@ -16,11 +16,11 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.convert; +package io.github.dsheirer.audio.convert; -import audio.AudioFormats; -import audio.AudioPacket; -import audio.AudioUtils; +import io.github.dsheirer.audio.AudioFormats; +import io.github.dsheirer.audio.AudioPacket; +import io.github.dsheirer.audio.AudioUtils; import net.sourceforge.lame.lowlevel.LameEncoder; import net.sourceforge.lame.mp3.Lame; import net.sourceforge.lame.mp3.MPEGMode; diff --git a/src/audio/convert/MP3FrameInspector.java b/src/main/java/io/github/dsheirer/audio/convert/MP3FrameInspector.java similarity index 98% rename from src/audio/convert/MP3FrameInspector.java rename to src/main/java/io/github/dsheirer/audio/convert/MP3FrameInspector.java index 56c91a4a..ecd5af31 100644 --- a/src/audio/convert/MP3FrameInspector.java +++ b/src/main/java/io/github/dsheirer/audio/convert/MP3FrameInspector.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.convert; +package io.github.dsheirer.audio.convert; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/audio/convert/MP3SilenceGenerator.java b/src/main/java/io/github/dsheirer/audio/convert/MP3SilenceGenerator.java similarity index 96% rename from src/audio/convert/MP3SilenceGenerator.java rename to src/main/java/io/github/dsheirer/audio/convert/MP3SilenceGenerator.java index 8e68e6f3..e9e429f3 100644 --- a/src/audio/convert/MP3SilenceGenerator.java +++ b/src/main/java/io/github/dsheirer/audio/convert/MP3SilenceGenerator.java @@ -16,12 +16,12 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.convert; +package io.github.dsheirer.audio.convert; -import audio.AudioPacket; +import io.github.dsheirer.audio.AudioPacket; +import io.github.dsheirer.record.mp3.MP3Recorder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import record.mp3.MP3Recorder; import java.util.ArrayList; import java.util.Arrays; diff --git a/src/audio/invert/AudioAdapter.java b/src/main/java/io/github/dsheirer/audio/invert/AudioAdapter.java similarity index 91% rename from src/audio/invert/AudioAdapter.java rename to src/main/java/io/github/dsheirer/audio/invert/AudioAdapter.java index db45c734..090c002c 100644 --- a/src/audio/invert/AudioAdapter.java +++ b/src/main/java/io/github/dsheirer/audio/invert/AudioAdapter.java @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package audio.invert; +package io.github.dsheirer.audio.invert; -import dsp.filter.FilterFactory; -import dsp.filter.FloatFIRFilter; -import dsp.filter.Window.WindowType; -import dsp.mixer.Oscillator; +import io.github.dsheirer.dsp.filter.FilterFactory; +import io.github.dsheirer.dsp.filter.FloatFIRFilter; +import io.github.dsheirer.dsp.filter.Window.WindowType; +import io.github.dsheirer.dsp.mixer.Oscillator; /** * Based on the AudioType applied, produces normal, muted, or audio invert diff --git a/src/audio/invert/AudioInverter.java b/src/main/java/io/github/dsheirer/audio/invert/AudioInverter.java similarity index 89% rename from src/audio/invert/AudioInverter.java rename to src/main/java/io/github/dsheirer/audio/invert/AudioInverter.java index f9ec3755..a892b23c 100644 --- a/src/audio/invert/AudioInverter.java +++ b/src/main/java/io/github/dsheirer/audio/invert/AudioInverter.java @@ -15,13 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package audio.invert; +package io.github.dsheirer.audio.invert; -import audio.InversionFrequency; -import sample.real.RealSampleListener; -import dsp.filter.Filters; -import dsp.filter.FloatFIRFilter; -import dsp.mixer.Oscillator; +import io.github.dsheirer.audio.InversionFrequency; +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 @@ -56,7 +56,7 @@ public class AudioInverter implements RealSampleListener @Override public void receive( float sample ) { - //Multiply the sample by the folding frequency and then send it to + //Multiply the sample by the folding frequency and then send it to //the low pass filter if( mPostInversionLowPassFilter != null ) { diff --git a/src/audio/invert/AudioType.java b/src/main/java/io/github/dsheirer/audio/invert/AudioType.java similarity index 98% rename from src/audio/invert/AudioType.java rename to src/main/java/io/github/dsheirer/audio/invert/AudioType.java index 0659b781..d348d6c2 100644 --- a/src/audio/invert/AudioType.java +++ b/src/main/java/io/github/dsheirer/audio/invert/AudioType.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package audio.invert; +package io.github.dsheirer.audio.invert; public enum AudioType { diff --git a/src/audio/invert/IAudioTypeListener.java b/src/main/java/io/github/dsheirer/audio/invert/IAudioTypeListener.java similarity index 96% rename from src/audio/invert/IAudioTypeListener.java rename to src/main/java/io/github/dsheirer/audio/invert/IAudioTypeListener.java index a55feec1..3b503abd 100644 --- a/src/audio/invert/IAudioTypeListener.java +++ b/src/main/java/io/github/dsheirer/audio/invert/IAudioTypeListener.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package audio.invert; +package io.github.dsheirer.audio.invert; public interface IAudioTypeListener diff --git a/src/audio/output/AudioOutput.java b/src/main/java/io/github/dsheirer/audio/output/AudioOutput.java similarity index 96% rename from src/audio/output/AudioOutput.java rename to src/main/java/io/github/dsheirer/audio/output/AudioOutput.java index f27dd8b3..0742543a 100644 --- a/src/audio/output/AudioOutput.java +++ b/src/main/java/io/github/dsheirer/audio/output/AudioOutput.java @@ -16,18 +16,17 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.output; +package io.github.dsheirer.audio.output; -import audio.AudioEvent; -import audio.AudioPacket; -import audio.AudioPacket.Type; -import channel.metadata.Metadata; +import io.github.dsheirer.audio.AudioEvent; +import io.github.dsheirer.audio.AudioPacket; +import io.github.dsheirer.channel.metadata.Metadata; +import io.github.dsheirer.sample.Broadcaster; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.source.mixer.MixerChannel; +import io.github.dsheirer.util.ThreadPool; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Broadcaster; -import sample.Listener; -import source.mixer.MixerChannel; -import util.ThreadPool; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.BooleanControl; @@ -307,7 +306,7 @@ public abstract class AudioOutput implements Listener, LineListener for(AudioPacket packet : packets) { - if(packet.getType() == Type.AUDIO) + if(packet.getType() == AudioPacket.Type.AUDIO) { broadcast(packet.getMetadata()); diff --git a/src/audio/output/MonoAudioOutput.java b/src/main/java/io/github/dsheirer/audio/output/MonoAudioOutput.java similarity index 91% rename from src/audio/output/MonoAudioOutput.java rename to src/main/java/io/github/dsheirer/audio/output/MonoAudioOutput.java index c8c7c267..aedbc62c 100644 --- a/src/audio/output/MonoAudioOutput.java +++ b/src/main/java/io/github/dsheirer/audio/output/MonoAudioOutput.java @@ -16,11 +16,11 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.output; +package io.github.dsheirer.audio.output; -import audio.AudioFormats; -import audio.AudioPacket; -import source.mixer.MixerChannel; +import io.github.dsheirer.audio.AudioFormats; +import io.github.dsheirer.audio.AudioPacket; +import io.github.dsheirer.source.mixer.MixerChannel; import javax.sound.sampled.Mixer; import java.nio.ByteBuffer; diff --git a/src/audio/output/StereoAudioOutput.java b/src/main/java/io/github/dsheirer/audio/output/StereoAudioOutput.java similarity index 93% rename from src/audio/output/StereoAudioOutput.java rename to src/main/java/io/github/dsheirer/audio/output/StereoAudioOutput.java index 54c90150..96134621 100644 --- a/src/audio/output/StereoAudioOutput.java +++ b/src/main/java/io/github/dsheirer/audio/output/StereoAudioOutput.java @@ -16,11 +16,11 @@ * along with this program. If not, see * ******************************************************************************/ -package audio.output; +package io.github.dsheirer.audio.output; -import audio.AudioFormats; -import audio.AudioPacket; -import source.mixer.MixerChannel; +import io.github.dsheirer.audio.AudioFormats; +import io.github.dsheirer.audio.AudioPacket; +import io.github.dsheirer.source.mixer.MixerChannel; import javax.sound.sampled.Mixer; import java.nio.ByteBuffer; diff --git a/src/audio/squelch/ISquelchStateListener.java b/src/main/java/io/github/dsheirer/audio/squelch/ISquelchStateListener.java similarity index 54% rename from src/audio/squelch/ISquelchStateListener.java rename to src/main/java/io/github/dsheirer/audio/squelch/ISquelchStateListener.java index d5738f51..0d7249a7 100644 --- a/src/audio/squelch/ISquelchStateListener.java +++ b/src/main/java/io/github/dsheirer/audio/squelch/ISquelchStateListener.java @@ -1,6 +1,6 @@ -package audio.squelch; +package io.github.dsheirer.audio.squelch; -import sample.Listener; +import io.github.dsheirer.sample.Listener; public interface ISquelchStateListener { diff --git a/src/audio/squelch/ISquelchStateProvider.java b/src/main/java/io/github/dsheirer/audio/squelch/ISquelchStateProvider.java similarity index 65% rename from src/audio/squelch/ISquelchStateProvider.java rename to src/main/java/io/github/dsheirer/audio/squelch/ISquelchStateProvider.java index 93b435f2..908dad7a 100644 --- a/src/audio/squelch/ISquelchStateProvider.java +++ b/src/main/java/io/github/dsheirer/audio/squelch/ISquelchStateProvider.java @@ -1,6 +1,6 @@ -package audio.squelch; +package io.github.dsheirer.audio.squelch; -import sample.Listener; +import io.github.dsheirer.sample.Listener; public interface ISquelchStateProvider { diff --git a/src/audio/squelch/ManualSquelchController.java b/src/main/java/io/github/dsheirer/audio/squelch/ManualSquelchController.java similarity index 97% rename from src/audio/squelch/ManualSquelchController.java rename to src/main/java/io/github/dsheirer/audio/squelch/ManualSquelchController.java index cce0ed53..b0e93ac4 100644 --- a/src/audio/squelch/ManualSquelchController.java +++ b/src/main/java/io/github/dsheirer/audio/squelch/ManualSquelchController.java @@ -16,7 +16,7 @@ * along with this program. If not, see ******************************************************************************/ -package audio.squelch; +package io.github.dsheirer.audio.squelch; /** diff --git a/src/audio/squelch/SquelchController.java b/src/main/java/io/github/dsheirer/audio/squelch/SquelchController.java similarity index 90% rename from src/audio/squelch/SquelchController.java rename to src/main/java/io/github/dsheirer/audio/squelch/SquelchController.java index af4eaec9..43c88005 100644 --- a/src/audio/squelch/SquelchController.java +++ b/src/main/java/io/github/dsheirer/audio/squelch/SquelchController.java @@ -16,20 +16,20 @@ * along with this program. If not, see ******************************************************************************/ -package audio.squelch; +package io.github.dsheirer.audio.squelch; -import sample.Broadcaster; -import sample.Listener; -import sample.real.RealBuffer; -import sample.real.RealSampleListener; -import sample.real.RealToRealBufferAssembler; +import io.github.dsheirer.sample.Broadcaster; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.RealBuffer; +import io.github.dsheirer.sample.real.RealSampleListener; +import io.github.dsheirer.sample.real.RealToRealBufferAssembler; /** * Squelch control - receives single audio samples or real audio buffers and * adjusts squelch state either based on the audio samples or based on external * control inputs. * - * Assembles received single audio samples into real sample buffers for + * Assembles received single audio samples into real sample buffers for * consumption by an external audio processor, like the AudioPacketProcessor * class. */ diff --git a/src/audio/squelch/SquelchMode.java b/src/main/java/io/github/dsheirer/audio/squelch/SquelchMode.java similarity index 81% rename from src/audio/squelch/SquelchMode.java rename to src/main/java/io/github/dsheirer/audio/squelch/SquelchMode.java index d5f09b9d..4ec0d929 100644 --- a/src/audio/squelch/SquelchMode.java +++ b/src/main/java/io/github/dsheirer/audio/squelch/SquelchMode.java @@ -1,8 +1,8 @@ -package audio.squelch; +package io.github.dsheirer.audio.squelch; /** * Squelch state for a decoding channel. The state determines the handling of - * any audio packets processed by the channel state. + * any audio packets processed by the channel state. */ public enum SquelchMode { diff --git a/src/audio/squelch/SquelchState.java b/src/main/java/io/github/dsheirer/audio/squelch/SquelchState.java similarity index 55% rename from src/audio/squelch/SquelchState.java rename to src/main/java/io/github/dsheirer/audio/squelch/SquelchState.java index 1093eae8..2276502d 100644 --- a/src/audio/squelch/SquelchState.java +++ b/src/main/java/io/github/dsheirer/audio/squelch/SquelchState.java @@ -1,4 +1,4 @@ -package audio.squelch; +package io.github.dsheirer.audio.squelch; public enum SquelchState { diff --git a/src/audio/squelch/TrunkingSquelchController.java b/src/main/java/io/github/dsheirer/audio/squelch/TrunkingSquelchController.java similarity index 97% rename from src/audio/squelch/TrunkingSquelchController.java rename to src/main/java/io/github/dsheirer/audio/squelch/TrunkingSquelchController.java index 18d50341..fbb3e843 100644 --- a/src/audio/squelch/TrunkingSquelchController.java +++ b/src/main/java/io/github/dsheirer/audio/squelch/TrunkingSquelchController.java @@ -16,7 +16,7 @@ * along with this program. If not, see ******************************************************************************/ -package audio.squelch; +package io.github.dsheirer.audio.squelch; public class TrunkingSquelchController extends SquelchController { @@ -27,7 +27,7 @@ public class TrunkingSquelchController extends SquelchController } /** - * Provides control over audio stream as directed by an external trunking + * Provides control over audio stream as directed by an external trunking * channel state. * * Override automatic squelch control by setting the squelch mode to none. diff --git a/src/bits/BinaryMessage.java b/src/main/java/io/github/dsheirer/bits/BinaryMessage.java similarity index 99% rename from src/bits/BinaryMessage.java rename to src/main/java/io/github/dsheirer/bits/BinaryMessage.java index c3caba05..8ce03554 100644 --- a/src/bits/BinaryMessage.java +++ b/src/main/java/io/github/dsheirer/bits/BinaryMessage.java @@ -15,15 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package bits; +package io.github.dsheirer.bits; -import java.util.Arrays; -import java.util.BitSet; -import java.util.logging.LogManager; - -import edac.CRC; +import io.github.dsheirer.edac.CRC; import org.apache.commons.lang3.Validate; +import java.util.BitSet; + public class BinaryMessage extends BitSet { private static final long serialVersionUID = 1L; @@ -113,7 +111,7 @@ public class BinaryMessage extends BitSet } /** - * Returns a mew binary message containing the bits from (inclusive) to + * Returns a mew binary message containing the bits from (inclusive) to * end (exclusive). * * @param start @@ -176,12 +174,12 @@ public class BinaryMessage extends BitSet /** * Static method to construct a new BitSetBuffer, preloaded with the bits - * from the preload parameter, and then filled with the bits from the + * from the preload parameter, and then filled with the bits from the * second bitsetbuffer parameter. * * @param preloadBits - boolean array of bits to be prepended to the new * bitset - * @param bitsetToAppend - full bitset to be appended to the residual bits array + * @param bitsetToAppend - full bitset to be appended to the residual bits array * @return - new Bitset preloaded with residual bits and new bitset */ public static BinaryMessage merge( boolean[] preloadBits, BinaryMessage bitsetToAppend ) @@ -266,7 +264,7 @@ public class BinaryMessage extends BitSet else { throw new BitSetFullException( "bitset is full -- contains " + - ( mPointer + 1 ) + " bits" ); + ( mPointer + 1 ) + "bits"); } } @@ -545,7 +543,7 @@ public class BinaryMessage extends BitSet /** - * Converts up to 63 bits from the bit array into an integer and then + * Converts up to 63 bits from the bit array into an integer and then * formats the value into hexadecimal, prefixing the value with zeros to * provide a total length of digitDisplayCount; * diff --git a/src/bits/BitSetFullException.java b/src/main/java/io/github/dsheirer/bits/BitSetFullException.java similarity index 97% rename from src/bits/BitSetFullException.java rename to src/main/java/io/github/dsheirer/bits/BitSetFullException.java index 7467c809..592c7a3f 100644 --- a/src/bits/BitSetFullException.java +++ b/src/main/java/io/github/dsheirer/bits/BitSetFullException.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package bits; +package io.github.dsheirer.bits; public class BitSetFullException extends Exception { diff --git a/src/bits/CorrectedBinaryMessage.java b/src/main/java/io/github/dsheirer/bits/CorrectedBinaryMessage.java similarity index 98% rename from src/bits/CorrectedBinaryMessage.java rename to src/main/java/io/github/dsheirer/bits/CorrectedBinaryMessage.java index 597830d3..a06f45af 100644 --- a/src/bits/CorrectedBinaryMessage.java +++ b/src/main/java/io/github/dsheirer/bits/CorrectedBinaryMessage.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package bits; +package io.github.dsheirer.bits; import java.util.BitSet; diff --git a/src/bits/ISyncDetectListener.java b/src/main/java/io/github/dsheirer/bits/ISyncDetectListener.java similarity index 68% rename from src/bits/ISyncDetectListener.java rename to src/main/java/io/github/dsheirer/bits/ISyncDetectListener.java index dfa4e5f2..bbe93440 100644 --- a/src/bits/ISyncDetectListener.java +++ b/src/main/java/io/github/dsheirer/bits/ISyncDetectListener.java @@ -1,4 +1,4 @@ -package bits; +package io.github.dsheirer.bits; public interface ISyncDetectListener { diff --git a/src/bits/ISyncProcessor.java b/src/main/java/io/github/dsheirer/bits/ISyncProcessor.java similarity index 69% rename from src/bits/ISyncProcessor.java rename to src/main/java/io/github/dsheirer/bits/ISyncProcessor.java index 131faca7..52acb572 100644 --- a/src/bits/ISyncProcessor.java +++ b/src/main/java/io/github/dsheirer/bits/ISyncProcessor.java @@ -1,4 +1,4 @@ -package bits; +package io.github.dsheirer.bits; public interface ISyncProcessor { diff --git a/src/bits/MessageFramer.java b/src/main/java/io/github/dsheirer/bits/MessageFramer.java similarity index 95% rename from src/bits/MessageFramer.java rename to src/main/java/io/github/dsheirer/bits/MessageFramer.java index 32b4ab03..79596cae 100644 --- a/src/bits/MessageFramer.java +++ b/src/main/java/io/github/dsheirer/bits/MessageFramer.java @@ -15,19 +15,19 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package bits; +package io.github.dsheirer.bits; + +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; -import sample.Broadcaster; -import sample.Listener; -import dsp.symbol.SyncDetectListener; -import dsp.symbol.SyncDetectProvider; - /** * MessageFramer - processes bitsets looking for a sync pattern within - * the bits, and then extracts the message, including the sync + * the bits, and then extracts the message, including the sync * pattern, for a total bit length of messageLength. * * Will extract multiple messages simultaneously, for each sync pattern that is @@ -162,7 +162,7 @@ public class MessageFramer implements Listener, } /** - * Assembles a binary message, starting with the initial fill of the + * Assembles a binary message, starting with the initial fill of the * identified sync pattern, and every bit thereafter. Once the accumulated * bits equal the message length, the message is sent and the assembler * flags itself as complete. @@ -221,7 +221,7 @@ public class MessageFramer implements Listener, } /** - * Flushes/Sends the current message, or partial message, and sets + * Flushes/Sends the current message, or partial message, and sets * complete flag to true, so that we can be auto-removed */ public void flush() diff --git a/src/bits/MultiSyncPatternMatcher.java b/src/main/java/io/github/dsheirer/bits/MultiSyncPatternMatcher.java similarity index 98% rename from src/bits/MultiSyncPatternMatcher.java rename to src/main/java/io/github/dsheirer/bits/MultiSyncPatternMatcher.java index 6de0d5ed..c313b484 100644 --- a/src/bits/MultiSyncPatternMatcher.java +++ b/src/main/java/io/github/dsheirer/bits/MultiSyncPatternMatcher.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package bits; +package io.github.dsheirer.bits; import org.apache.commons.lang3.Validate; @@ -26,7 +26,7 @@ import java.util.List; * Multi-Sync pattern matcher. Accepts multiple sync detector objects for * comparision against the incoming bit stream. * - * Note: works for sync patterns up to 63 bits (integer size - 1 ) long. + * Note: works for sync patterns up to 63 bits (integer size - 1 ) long. * If a 64 bit or larger sync pattern is applied, then the wrapping feature * of the Long.rotate methods will wrap the MSB around to the LSB and * corrupt the matching value. diff --git a/src/bits/SoftSyncDetector.java b/src/main/java/io/github/dsheirer/bits/SoftSyncDetector.java similarity index 96% rename from src/bits/SoftSyncDetector.java rename to src/main/java/io/github/dsheirer/bits/SoftSyncDetector.java index c23ca430..1a285f70 100644 --- a/src/bits/SoftSyncDetector.java +++ b/src/main/java/io/github/dsheirer/bits/SoftSyncDetector.java @@ -1,4 +1,4 @@ -package bits; +package io.github.dsheirer.bits; public class SoftSyncDetector implements ISyncProcessor { diff --git a/src/bits/SyncDetector.java b/src/main/java/io/github/dsheirer/bits/SyncDetector.java similarity index 94% rename from src/bits/SyncDetector.java rename to src/main/java/io/github/dsheirer/bits/SyncDetector.java index aaeb4b0a..fd8e2091 100644 --- a/src/bits/SyncDetector.java +++ b/src/main/java/io/github/dsheirer/bits/SyncDetector.java @@ -1,4 +1,4 @@ -package bits; +package io.github.dsheirer.bits; public class SyncDetector implements ISyncProcessor { diff --git a/src/bits/SyncPattern.java b/src/main/java/io/github/dsheirer/bits/SyncPattern.java similarity index 99% rename from src/bits/SyncPattern.java rename to src/main/java/io/github/dsheirer/bits/SyncPattern.java index c68d9025..5ef8f4be 100644 --- a/src/bits/SyncPattern.java +++ b/src/main/java/io/github/dsheirer/bits/SyncPattern.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package bits; +package io.github.dsheirer.bits; public enum SyncPattern { diff --git a/src/bits/SyncPatternMatcher.java b/src/main/java/io/github/dsheirer/bits/SyncPatternMatcher.java similarity index 98% rename from src/bits/SyncPatternMatcher.java rename to src/main/java/io/github/dsheirer/bits/SyncPatternMatcher.java index 675b655b..3748fa4e 100644 --- a/src/bits/SyncPatternMatcher.java +++ b/src/main/java/io/github/dsheirer/bits/SyncPatternMatcher.java @@ -15,13 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package bits; +package io.github.dsheirer.bits; /** * Sync pattern matcher. * - * Note: works for sync patterns up to 63 bits (integer size - 1 ) long. + * Note: works for sync patterns up to 63 bits (integer size - 1 ) long. * If a 64 bit or larger sync pattern is applied, then the wrapping feature * of the Long.rotate methods will wrap the MSB around to the LSB and * corrupt the matching value. diff --git a/src/buffer/BooleanAveragingBuffer.java b/src/main/java/io/github/dsheirer/buffer/BooleanAveragingBuffer.java similarity index 96% rename from src/buffer/BooleanAveragingBuffer.java rename to src/main/java/io/github/dsheirer/buffer/BooleanAveragingBuffer.java index 73e6201e..5117972a 100644 --- a/src/buffer/BooleanAveragingBuffer.java +++ b/src/main/java/io/github/dsheirer/buffer/BooleanAveragingBuffer.java @@ -15,13 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package buffer; +package io.github.dsheirer.buffer; import java.util.Arrays; /** - * Circular Buffer - implements a circular buffer with a method to get the + * Circular Buffer - implements a circular buffer with a method to get the * current head of the buffer, and put a new value in its place at the same * time * @@ -92,7 +92,7 @@ public class BooleanAveragingBuffer { } /** - * If the number of true values in the buffer is + * If the number of true values in the buffer is * more than half, return true, otherwise, false */ if( trueCount > (int)( mBuffer.length / 2 ) ) diff --git a/src/buffer/CircularBuffer.java b/src/main/java/io/github/dsheirer/buffer/CircularBuffer.java similarity index 95% rename from src/buffer/CircularBuffer.java rename to src/main/java/io/github/dsheirer/buffer/CircularBuffer.java index bb815cc4..fd92b870 100644 --- a/src/buffer/CircularBuffer.java +++ b/src/main/java/io/github/dsheirer/buffer/CircularBuffer.java @@ -1,11 +1,11 @@ -package buffer; +package io.github.dsheirer.buffer; + +import io.github.dsheirer.sample.Listener; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import sample.Listener; - public class CircularBuffer implements Listener { private ArrayList mElements; diff --git a/src/buffer/ComplexCircularBuffer.java b/src/main/java/io/github/dsheirer/buffer/ComplexCircularBuffer.java similarity index 95% rename from src/buffer/ComplexCircularBuffer.java rename to src/main/java/io/github/dsheirer/buffer/ComplexCircularBuffer.java index f375a658..7dbbed04 100644 --- a/src/buffer/ComplexCircularBuffer.java +++ b/src/main/java/io/github/dsheirer/buffer/ComplexCircularBuffer.java @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package buffer; +package io.github.dsheirer.buffer; + +import io.github.dsheirer.sample.complex.Complex; import java.util.Arrays; -import sample.complex.Complex; - /** * Circular sample buffer - allocates a buffer and stores samples in a circular * fashion, overwriting older samples with newly arrived samples. Initially @@ -41,7 +41,7 @@ public class ComplexCircularBuffer } /** - * Returns the sample currently pointed to in the buffer and stores the + * Returns the sample currently pointed to in the buffer and stores the * new sample in its place * @param sample * @return diff --git a/src/buffer/ComplexTappedCircularBuffer.java b/src/main/java/io/github/dsheirer/buffer/ComplexTappedCircularBuffer.java similarity index 95% rename from src/buffer/ComplexTappedCircularBuffer.java rename to src/main/java/io/github/dsheirer/buffer/ComplexTappedCircularBuffer.java index 214738d3..2acc34dd 100644 --- a/src/buffer/ComplexTappedCircularBuffer.java +++ b/src/main/java/io/github/dsheirer/buffer/ComplexTappedCircularBuffer.java @@ -15,14 +15,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package buffer; +package io.github.dsheirer.buffer; -import sample.complex.Complex; +import io.github.dsheirer.sample.complex.Complex; /** * Implements a FIFO circular buffer for complex samples that provides access * to each complex sample by index number, where index 0 is the newest/latest - * complex sample and index (length - 1) is the oldest sample in the buffer. + * complex sample and index (length - 1) is the oldest sample in the buffer. */ public class ComplexTappedCircularBuffer { @@ -48,7 +48,7 @@ public class ComplexTappedCircularBuffer { mBuffer[ mBufferPointer++ ] = sample; - //Reset the buffer pointer once it points past the end of the buffer + //Reset the buffer pointer once it points past the end of the buffer if( mBufferPointer >= mBuffer.length ) { mBufferPointer = 0; @@ -56,9 +56,9 @@ public class ComplexTappedCircularBuffer } /** - * Retrieves a sample currently in the buffer by index position. + * Retrieves a sample currently in the buffer by index position. * - * Index 0 is the newest/latest sample in the buffer and index (length - 1) + * Index 0 is the newest/latest sample in the buffer and index (length - 1) * is the oldest. * * Note: the buffer is preloaded with complex samples of 0,0 value. diff --git a/src/buffer/DoubleCircularBuffer.java b/src/main/java/io/github/dsheirer/buffer/DoubleCircularBuffer.java similarity index 98% rename from src/buffer/DoubleCircularBuffer.java rename to src/main/java/io/github/dsheirer/buffer/DoubleCircularBuffer.java index 5759279c..0c9172fe 100644 --- a/src/buffer/DoubleCircularBuffer.java +++ b/src/main/java/io/github/dsheirer/buffer/DoubleCircularBuffer.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package buffer; +package io.github.dsheirer.buffer; import java.util.Arrays; diff --git a/src/buffer/FloatAveragingBuffer.java b/src/main/java/io/github/dsheirer/buffer/FloatAveragingBuffer.java similarity index 97% rename from src/buffer/FloatAveragingBuffer.java rename to src/main/java/io/github/dsheirer/buffer/FloatAveragingBuffer.java index 9fb88be3..fb34b488 100644 --- a/src/buffer/FloatAveragingBuffer.java +++ b/src/main/java/io/github/dsheirer/buffer/FloatAveragingBuffer.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package buffer; +package io.github.dsheirer.buffer; public class FloatAveragingBuffer { diff --git a/src/buffer/FloatCircularBuffer.java b/src/main/java/io/github/dsheirer/buffer/FloatCircularBuffer.java similarity index 98% rename from src/buffer/FloatCircularBuffer.java rename to src/main/java/io/github/dsheirer/buffer/FloatCircularBuffer.java index ccb749e1..ce3d0bd3 100644 --- a/src/buffer/FloatCircularBuffer.java +++ b/src/main/java/io/github/dsheirer/buffer/FloatCircularBuffer.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package buffer; +package io.github.dsheirer.buffer; import java.util.Arrays; diff --git a/src/channel/details/ChannelDetailPanel.java b/src/main/java/io/github/dsheirer/channel/details/ChannelDetailPanel.java similarity index 92% rename from src/channel/details/ChannelDetailPanel.java rename to src/main/java/io/github/dsheirer/channel/details/ChannelDetailPanel.java index 4f41e267..e93a4234 100644 --- a/src/channel/details/ChannelDetailPanel.java +++ b/src/main/java/io/github/dsheirer/channel/details/ChannelDetailPanel.java @@ -16,14 +16,14 @@ * along with this program. If not, see * ******************************************************************************/ -package channel.details; +package io.github.dsheirer.channel.details; -import channel.state.DecoderState; -import controller.channel.Channel; -import controller.channel.ChannelProcessingManager; -import module.ProcessingChain; +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 sample.Listener; import javax.swing.*; import javax.swing.text.DefaultCaret; diff --git a/src/channel/heartbeat/Heartbeat.java b/src/main/java/io/github/dsheirer/channel/heartbeat/Heartbeat.java similarity index 96% rename from src/channel/heartbeat/Heartbeat.java rename to src/main/java/io/github/dsheirer/channel/heartbeat/Heartbeat.java index 4799754e..72946df0 100644 --- a/src/channel/heartbeat/Heartbeat.java +++ b/src/main/java/io/github/dsheirer/channel/heartbeat/Heartbeat.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package channel.heartbeat; +package io.github.dsheirer.channel.heartbeat; public class Heartbeat { diff --git a/src/channel/heartbeat/IHeartbeatListener.java b/src/main/java/io/github/dsheirer/channel/heartbeat/IHeartbeatListener.java similarity index 91% rename from src/channel/heartbeat/IHeartbeatListener.java rename to src/main/java/io/github/dsheirer/channel/heartbeat/IHeartbeatListener.java index 904d0501..f3bcb319 100644 --- a/src/channel/heartbeat/IHeartbeatListener.java +++ b/src/main/java/io/github/dsheirer/channel/heartbeat/IHeartbeatListener.java @@ -16,9 +16,9 @@ * along with this program. If not, see * ******************************************************************************/ -package channel.heartbeat; +package io.github.dsheirer.channel.heartbeat; -import sample.Listener; +import io.github.dsheirer.sample.Listener; public interface IHeartbeatListener { diff --git a/src/channel/heartbeat/IHeartbeatProvider.java b/src/main/java/io/github/dsheirer/channel/heartbeat/IHeartbeatProvider.java similarity index 91% rename from src/channel/heartbeat/IHeartbeatProvider.java rename to src/main/java/io/github/dsheirer/channel/heartbeat/IHeartbeatProvider.java index 3583cd42..8d2ab3c3 100644 --- a/src/channel/heartbeat/IHeartbeatProvider.java +++ b/src/main/java/io/github/dsheirer/channel/heartbeat/IHeartbeatProvider.java @@ -16,9 +16,9 @@ * along with this program. If not, see * ******************************************************************************/ -package channel.heartbeat; +package io.github.dsheirer.channel.heartbeat; -import sample.Listener; +import io.github.dsheirer.sample.Listener; public interface IHeartbeatProvider { diff --git a/src/channel/metadata/AliasedIdentifier.java b/src/main/java/io/github/dsheirer/channel/metadata/AliasedIdentifier.java similarity index 96% rename from src/channel/metadata/AliasedIdentifier.java rename to src/main/java/io/github/dsheirer/channel/metadata/AliasedIdentifier.java index 4bf56342..a9bf91f2 100644 --- a/src/channel/metadata/AliasedIdentifier.java +++ b/src/main/java/io/github/dsheirer/channel/metadata/AliasedIdentifier.java @@ -16,9 +16,9 @@ * along with this program. If not, see * ******************************************************************************/ -package channel.metadata; +package io.github.dsheirer.channel.metadata; -import alias.Alias; +import io.github.dsheirer.alias.Alias; public class AliasedIdentifier { diff --git a/src/channel/metadata/AliasedIntegerAttributeMonitor.java b/src/main/java/io/github/dsheirer/channel/metadata/AliasedIntegerAttributeMonitor.java similarity index 89% rename from src/channel/metadata/AliasedIntegerAttributeMonitor.java rename to src/main/java/io/github/dsheirer/channel/metadata/AliasedIntegerAttributeMonitor.java index dbc0b6ae..a79bfaf7 100644 --- a/src/channel/metadata/AliasedIntegerAttributeMonitor.java +++ b/src/main/java/io/github/dsheirer/channel/metadata/AliasedIntegerAttributeMonitor.java @@ -16,14 +16,16 @@ * along with this program. If not, see * ******************************************************************************/ -package channel.metadata; +package io.github.dsheirer.channel.metadata; -import alias.Alias; -import alias.AliasList; -import alias.id.AliasIDType; -import sample.Listener; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.alias.id.AliasIDType; +import io.github.dsheirer.sample.Listener; + +import static io.github.dsheirer.alias.id.AliasIDType.LTR_NET_UID; +import static io.github.dsheirer.alias.id.AliasIDType.STATUS; -import static alias.id.AliasIDType.*; public class AliasedIntegerAttributeMonitor extends AttributeMonitor { diff --git a/src/channel/metadata/AliasedStringAttributeMonitor.java b/src/main/java/io/github/dsheirer/channel/metadata/AliasedStringAttributeMonitor.java similarity index 84% rename from src/channel/metadata/AliasedStringAttributeMonitor.java rename to src/main/java/io/github/dsheirer/channel/metadata/AliasedStringAttributeMonitor.java index 216653e5..1f224478 100644 --- a/src/channel/metadata/AliasedStringAttributeMonitor.java +++ b/src/main/java/io/github/dsheirer/channel/metadata/AliasedStringAttributeMonitor.java @@ -16,14 +16,21 @@ * along with this program. If not, see * ******************************************************************************/ -package channel.metadata; +package io.github.dsheirer.channel.metadata; -import alias.Alias; -import alias.AliasList; -import alias.id.AliasIDType; -import sample.Listener; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.alias.id.AliasIDType; +import io.github.dsheirer.sample.Listener; + +import static io.github.dsheirer.alias.id.AliasIDType.ESN; +import static io.github.dsheirer.alias.id.AliasIDType.FLEETSYNC; +import static io.github.dsheirer.alias.id.AliasIDType.MDC1200; +import static io.github.dsheirer.alias.id.AliasIDType.MIN; +import static io.github.dsheirer.alias.id.AliasIDType.MPT1327; +import static io.github.dsheirer.alias.id.AliasIDType.SITE; +import static io.github.dsheirer.alias.id.AliasIDType.TALKGROUP; -import static alias.id.AliasIDType.*; public class AliasedStringAttributeMonitor extends AttributeMonitor { diff --git a/src/channel/metadata/Attribute.java b/src/main/java/io/github/dsheirer/channel/metadata/Attribute.java similarity index 96% rename from src/channel/metadata/Attribute.java rename to src/main/java/io/github/dsheirer/channel/metadata/Attribute.java index 3131591f..c3ec665f 100644 --- a/src/channel/metadata/Attribute.java +++ b/src/main/java/io/github/dsheirer/channel/metadata/Attribute.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package channel.metadata; +package io.github.dsheirer.channel.metadata; public enum Attribute { diff --git a/src/channel/metadata/AttributeChangeRequest.java b/src/main/java/io/github/dsheirer/channel/metadata/AttributeChangeRequest.java similarity index 95% rename from src/channel/metadata/AttributeChangeRequest.java rename to src/main/java/io/github/dsheirer/channel/metadata/AttributeChangeRequest.java index 94698451..d5f10637 100644 --- a/src/channel/metadata/AttributeChangeRequest.java +++ b/src/main/java/io/github/dsheirer/channel/metadata/AttributeChangeRequest.java @@ -16,10 +16,10 @@ * along with this program. If not, see * ******************************************************************************/ -package channel.metadata; +package io.github.dsheirer.channel.metadata; -import alias.Alias; -import module.decode.DecoderType; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.module.decode.DecoderType; public class AttributeChangeRequest { diff --git a/src/channel/metadata/AttributeMonitor.java b/src/main/java/io/github/dsheirer/channel/metadata/AttributeMonitor.java similarity index 97% rename from src/channel/metadata/AttributeMonitor.java rename to src/main/java/io/github/dsheirer/channel/metadata/AttributeMonitor.java index 013bdde5..2a7bc581 100644 --- a/src/channel/metadata/AttributeMonitor.java +++ b/src/main/java/io/github/dsheirer/channel/metadata/AttributeMonitor.java @@ -16,10 +16,10 @@ * along with this program. If not, see * ******************************************************************************/ -package channel.metadata; +package io.github.dsheirer.channel.metadata; -import alias.Alias; -import sample.Listener; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.sample.Listener; import java.util.ArrayList; import java.util.HashMap; diff --git a/src/channel/metadata/ChannelMetadataModel.java b/src/main/java/io/github/dsheirer/channel/metadata/ChannelMetadataModel.java similarity index 97% rename from src/channel/metadata/ChannelMetadataModel.java rename to src/main/java/io/github/dsheirer/channel/metadata/ChannelMetadataModel.java index 4d6844af..9198a9f5 100644 --- a/src/channel/metadata/ChannelMetadataModel.java +++ b/src/main/java/io/github/dsheirer/channel/metadata/ChannelMetadataModel.java @@ -16,11 +16,11 @@ * along with this program. If not, see * ******************************************************************************/ -package channel.metadata; +package io.github.dsheirer.channel.metadata; -import channel.state.State; -import controller.channel.Channel; -import sample.Listener; +import io.github.dsheirer.channel.state.State; +import io.github.dsheirer.controller.channel.Channel; +import io.github.dsheirer.sample.Listener; import javax.swing.table.AbstractTableModel; import java.awt.*; diff --git a/src/channel/metadata/ChannelMetadataPanel.java b/src/main/java/io/github/dsheirer/channel/metadata/ChannelMetadataPanel.java similarity index 95% rename from src/channel/metadata/ChannelMetadataPanel.java rename to src/main/java/io/github/dsheirer/channel/metadata/ChannelMetadataPanel.java index bd3fcbb1..b78129a2 100644 --- a/src/channel/metadata/ChannelMetadataPanel.java +++ b/src/main/java/io/github/dsheirer/channel/metadata/ChannelMetadataPanel.java @@ -16,22 +16,22 @@ * along with this program. If not, see * ******************************************************************************/ -package channel.metadata; +package io.github.dsheirer.channel.metadata; -import alias.Alias; -import channel.state.State; -import controller.channel.Channel; -import controller.channel.ChannelProcessingManager; -import controller.channel.ChannelUtils; -import icon.IconManager; -import module.ProcessingChain; +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; import net.miginfocom.swing.MigLayout; import org.apache.commons.lang3.Validate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import properties.SystemProperties; -import sample.Broadcaster; -import sample.Listener; import javax.swing.*; import javax.swing.event.ListSelectionEvent; diff --git a/src/channel/metadata/ChannelMetadataViewer.java b/src/main/java/io/github/dsheirer/channel/metadata/ChannelMetadataViewer.java similarity index 87% rename from src/channel/metadata/ChannelMetadataViewer.java rename to src/main/java/io/github/dsheirer/channel/metadata/ChannelMetadataViewer.java index e7efc2c2..f121508e 100644 --- a/src/channel/metadata/ChannelMetadataViewer.java +++ b/src/main/java/io/github/dsheirer/channel/metadata/ChannelMetadataViewer.java @@ -16,18 +16,18 @@ * along with this program. If not, see * ******************************************************************************/ -package channel.metadata; +package io.github.dsheirer.channel.metadata; -import channel.details.ChannelDetailPanel; import com.jidesoft.swing.JideSplitPane; import com.jidesoft.swing.JideTabbedPane; -import controller.channel.ChannelProcessingManager; -import icon.IconManager; -import module.decode.event.CallEventPanel; -import module.decode.event.MessageActivityPanel; +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 settings.SettingsManager; -import spectrum.ChannelSpectrumPanel; import javax.swing.*; import java.awt.*; diff --git a/src/channel/metadata/IAttributeChangeRequestListener.java b/src/main/java/io/github/dsheirer/channel/metadata/IAttributeChangeRequestListener.java similarity index 91% rename from src/channel/metadata/IAttributeChangeRequestListener.java rename to src/main/java/io/github/dsheirer/channel/metadata/IAttributeChangeRequestListener.java index b753569a..dc8c5522 100644 --- a/src/channel/metadata/IAttributeChangeRequestListener.java +++ b/src/main/java/io/github/dsheirer/channel/metadata/IAttributeChangeRequestListener.java @@ -16,9 +16,9 @@ * along with this program. If not, see * ******************************************************************************/ -package channel.metadata; +package io.github.dsheirer.channel.metadata; -import sample.Listener; +import io.github.dsheirer.sample.Listener; public interface IAttributeChangeRequestListener { diff --git a/src/channel/metadata/IAttributeChangeRequestProvider.java b/src/main/java/io/github/dsheirer/channel/metadata/IAttributeChangeRequestProvider.java similarity index 92% rename from src/channel/metadata/IAttributeChangeRequestProvider.java rename to src/main/java/io/github/dsheirer/channel/metadata/IAttributeChangeRequestProvider.java index c9b78cd1..32029532 100644 --- a/src/channel/metadata/IAttributeChangeRequestProvider.java +++ b/src/main/java/io/github/dsheirer/channel/metadata/IAttributeChangeRequestProvider.java @@ -16,9 +16,9 @@ * along with this program. If not, see * ******************************************************************************/ -package channel.metadata; +package io.github.dsheirer.channel.metadata; -import sample.Listener; +import io.github.dsheirer.sample.Listener; public interface IAttributeChangeRequestProvider { diff --git a/src/channel/metadata/Metadata.java b/src/main/java/io/github/dsheirer/channel/metadata/Metadata.java similarity index 98% rename from src/channel/metadata/Metadata.java rename to src/main/java/io/github/dsheirer/channel/metadata/Metadata.java index e3117dbf..5145053e 100644 --- a/src/channel/metadata/Metadata.java +++ b/src/main/java/io/github/dsheirer/channel/metadata/Metadata.java @@ -16,18 +16,16 @@ * along with this program. If not, see * ******************************************************************************/ -package channel.metadata; +package io.github.dsheirer.channel.metadata; -import alias.Alias; -import alias.id.broadcast.BroadcastChannel; -import alias.id.priority.Priority; -import channel.state.State; -import module.decode.DecoderType; +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.ArrayList; -import java.util.List; import java.util.Set; import java.util.TreeSet; diff --git a/src/channel/metadata/MutableMetadata.java b/src/main/java/io/github/dsheirer/channel/metadata/MutableMetadata.java similarity index 97% rename from src/channel/metadata/MutableMetadata.java rename to src/main/java/io/github/dsheirer/channel/metadata/MutableMetadata.java index 10ee7b96..5b7c6852 100644 --- a/src/channel/metadata/MutableMetadata.java +++ b/src/main/java/io/github/dsheirer/channel/metadata/MutableMetadata.java @@ -16,14 +16,14 @@ * along with this program. If not, see * ******************************************************************************/ -package channel.metadata; +package io.github.dsheirer.channel.metadata; -import channel.state.State; -import module.decode.DecoderType; +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 sample.Broadcaster; -import sample.Listener; public class MutableMetadata extends Metadata implements Listener { diff --git a/src/channel/metadata/MutableMetadataChangeEvent.java b/src/main/java/io/github/dsheirer/channel/metadata/MutableMetadataChangeEvent.java similarity index 97% rename from src/channel/metadata/MutableMetadataChangeEvent.java rename to src/main/java/io/github/dsheirer/channel/metadata/MutableMetadataChangeEvent.java index 41d4e911..c083140d 100644 --- a/src/channel/metadata/MutableMetadataChangeEvent.java +++ b/src/main/java/io/github/dsheirer/channel/metadata/MutableMetadataChangeEvent.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package channel.metadata; +package io.github.dsheirer.channel.metadata; public class MutableMetadataChangeEvent { diff --git a/src/channel/state/AlwaysUnsquelchedDecoderState.java b/src/main/java/io/github/dsheirer/channel/state/AlwaysUnsquelchedDecoderState.java similarity index 90% rename from src/channel/state/AlwaysUnsquelchedDecoderState.java rename to src/main/java/io/github/dsheirer/channel/state/AlwaysUnsquelchedDecoderState.java index ef6a0db0..e515d6d6 100644 --- a/src/channel/state/AlwaysUnsquelchedDecoderState.java +++ b/src/main/java/io/github/dsheirer/channel/state/AlwaysUnsquelchedDecoderState.java @@ -15,14 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package channel.state; +package io.github.dsheirer.channel.state; -import channel.metadata.Attribute; -import channel.metadata.AttributeChangeRequest; -import channel.state.DecoderStateEvent.Event; -import gui.SDRTrunk; -import message.Message; -import module.decode.DecoderType; +import io.github.dsheirer.channel.metadata.Attribute; +import io.github.dsheirer.channel.metadata.AttributeChangeRequest; +import io.github.dsheirer.channel.state.DecoderStateEvent.Event; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.module.decode.DecoderType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/channel/state/ChangeChannelTimeoutEvent.java b/src/main/java/io/github/dsheirer/channel/state/ChangeChannelTimeoutEvent.java similarity index 83% rename from src/channel/state/ChangeChannelTimeoutEvent.java rename to src/main/java/io/github/dsheirer/channel/state/ChangeChannelTimeoutEvent.java index 5fed00dc..df7679a4 100644 --- a/src/channel/state/ChangeChannelTimeoutEvent.java +++ b/src/main/java/io/github/dsheirer/channel/state/ChangeChannelTimeoutEvent.java @@ -1,6 +1,6 @@ -package channel.state; +package io.github.dsheirer.channel.state; -import controller.channel.Channel.ChannelType; +import io.github.dsheirer.controller.channel.Channel.ChannelType; /** * Allows decoders to change the call timeout setting in the channel state diff --git a/src/channel/state/ChannelState.java b/src/main/java/io/github/dsheirer/channel/state/ChannelState.java similarity index 93% rename from src/channel/state/ChannelState.java rename to src/main/java/io/github/dsheirer/channel/state/ChannelState.java index 30d7d796..ae83ec65 100644 --- a/src/channel/state/ChannelState.java +++ b/src/main/java/io/github/dsheirer/channel/state/ChannelState.java @@ -16,34 +16,34 @@ * along with this program. If not, see * ******************************************************************************/ -package channel.state; +package io.github.dsheirer.channel.state; -import audio.squelch.ISquelchStateProvider; -import audio.squelch.SquelchState; -import channel.heartbeat.Heartbeat; -import channel.heartbeat.IHeartbeatListener; -import channel.metadata.Attribute; -import channel.metadata.AttributeChangeRequest; -import channel.metadata.IAttributeChangeRequestListener; -import channel.metadata.MutableMetadata; -import channel.state.DecoderStateEvent.Event; -import channel.traffic.TrafficChannelManager; -import controller.channel.Channel.ChannelType; -import module.Module; -import module.decode.DecoderType; -import module.decode.config.DecodeConfiguration; -import module.decode.event.CallEvent; -import module.decode.event.ICallEventProvider; +import io.github.dsheirer.audio.squelch.ISquelchStateProvider; +import io.github.dsheirer.audio.squelch.SquelchState; +import io.github.dsheirer.channel.heartbeat.Heartbeat; +import io.github.dsheirer.channel.heartbeat.IHeartbeatListener; +import io.github.dsheirer.channel.metadata.Attribute; +import io.github.dsheirer.channel.metadata.AttributeChangeRequest; +import io.github.dsheirer.channel.metadata.IAttributeChangeRequestListener; +import io.github.dsheirer.channel.metadata.MutableMetadata; +import io.github.dsheirer.channel.state.DecoderStateEvent.Event; +import io.github.dsheirer.channel.traffic.TrafficChannelManager; +import io.github.dsheirer.controller.channel.Channel.ChannelType; +import io.github.dsheirer.module.Module; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.module.decode.config.DecodeConfiguration; +import io.github.dsheirer.module.decode.event.CallEvent; +import io.github.dsheirer.module.decode.event.ICallEventProvider; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.IOverflowListener; +import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent; +import io.github.dsheirer.source.tuner.frequency.IFrequencyChangeListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; -import sample.real.IOverflowListener; -import source.tuner.frequency.FrequencyChangeEvent; -import source.tuner.frequency.IFrequencyChangeListener; import java.util.concurrent.ScheduledExecutorService; -import static source.tuner.frequency.FrequencyChangeEvent.Event.NOTIFICATION_FREQUENCY_CHANGE; +import static io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent.Event.NOTIFICATION_FREQUENCY_CHANGE; public class ChannelState extends Module implements ICallEventProvider, IDecoderStateEventListener, IDecoderStateEventProvider, IFrequencyChangeListener, IHeartbeatListener, ISquelchStateProvider, diff --git a/src/channel/state/ChannelStateSelectionListener.java b/src/main/java/io/github/dsheirer/channel/state/ChannelStateSelectionListener.java similarity index 96% rename from src/channel/state/ChannelStateSelectionListener.java rename to src/main/java/io/github/dsheirer/channel/state/ChannelStateSelectionListener.java index 7ddcdc4a..cbdbcf93 100644 --- a/src/channel/state/ChannelStateSelectionListener.java +++ b/src/main/java/io/github/dsheirer/channel/state/ChannelStateSelectionListener.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package channel.state; +package io.github.dsheirer.channel.state; public interface ChannelStateSelectionListener diff --git a/src/channel/state/DecoderState.java b/src/main/java/io/github/dsheirer/channel/state/DecoderState.java similarity index 88% rename from src/channel/state/DecoderState.java rename to src/main/java/io/github/dsheirer/channel/state/DecoderState.java index 4e68bb8f..0ce9cfc2 100644 --- a/src/channel/state/DecoderState.java +++ b/src/main/java/io/github/dsheirer/channel/state/DecoderState.java @@ -1,17 +1,17 @@ -package channel.state; +package io.github.dsheirer.channel.state; -import alias.AliasList; -import channel.metadata.AttributeChangeRequest; -import channel.metadata.IAttributeChangeRequestProvider; -import message.IMessageListener; -import message.Message; -import module.Module; -import module.decode.DecoderType; -import module.decode.event.ActivitySummaryProvider; -import module.decode.event.CallEvent; -import module.decode.event.ICallEventProvider; -import sample.Broadcaster; -import sample.Listener; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.channel.metadata.AttributeChangeRequest; +import io.github.dsheirer.channel.metadata.IAttributeChangeRequestProvider; +import io.github.dsheirer.message.IMessageListener; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.module.Module; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.module.decode.event.ActivitySummaryProvider; +import io.github.dsheirer.module.decode.event.CallEvent; +import io.github.dsheirer.module.decode.event.ICallEventProvider; +import io.github.dsheirer.sample.Broadcaster; +import io.github.dsheirer.sample.Listener; /** * Channel state monitors the stream of decoded messages produced by the diff --git a/src/channel/state/DecoderStateEvent.java b/src/main/java/io/github/dsheirer/channel/state/DecoderStateEvent.java similarity index 95% rename from src/channel/state/DecoderStateEvent.java rename to src/main/java/io/github/dsheirer/channel/state/DecoderStateEvent.java index 02371c0d..ad853865 100644 --- a/src/channel/state/DecoderStateEvent.java +++ b/src/main/java/io/github/dsheirer/channel/state/DecoderStateEvent.java @@ -1,4 +1,4 @@ -package channel.state; +package io.github.dsheirer.channel.state; public class DecoderStateEvent { @@ -25,7 +25,7 @@ public class DecoderStateEvent { StringBuilder sb = new StringBuilder(); - sb.append( "Decoder State Event - source[" + mSource.getClass() + + sb.append( "Decoder State Event - source[" + mSource.getClass() + "] event[" + mEvent.toString() + "] state[" + mState.toString() + "] frequency [" + mFrequency + "]" ); diff --git a/src/channel/state/IDecoderStateEventListener.java b/src/main/java/io/github/dsheirer/channel/state/IDecoderStateEventListener.java similarity index 57% rename from src/channel/state/IDecoderStateEventListener.java rename to src/main/java/io/github/dsheirer/channel/state/IDecoderStateEventListener.java index 5f1f1866..6fd9015e 100644 --- a/src/channel/state/IDecoderStateEventListener.java +++ b/src/main/java/io/github/dsheirer/channel/state/IDecoderStateEventListener.java @@ -1,6 +1,6 @@ -package channel.state; +package io.github.dsheirer.channel.state; -import sample.Listener; +import io.github.dsheirer.sample.Listener; public interface IDecoderStateEventListener { diff --git a/src/channel/state/IDecoderStateEventProvider.java b/src/main/java/io/github/dsheirer/channel/state/IDecoderStateEventProvider.java similarity index 66% rename from src/channel/state/IDecoderStateEventProvider.java rename to src/main/java/io/github/dsheirer/channel/state/IDecoderStateEventProvider.java index 30a954ce..0e387e2e 100644 --- a/src/channel/state/IDecoderStateEventProvider.java +++ b/src/main/java/io/github/dsheirer/channel/state/IDecoderStateEventProvider.java @@ -1,6 +1,6 @@ -package channel.state; +package io.github.dsheirer.channel.state; -import sample.Listener; +import io.github.dsheirer.sample.Listener; public interface IDecoderStateEventProvider { diff --git a/src/channel/state/State.java b/src/main/java/io/github/dsheirer/channel/state/State.java similarity index 98% rename from src/channel/state/State.java rename to src/main/java/io/github/dsheirer/channel/state/State.java index f2c75767..d6e5b09f 100644 --- a/src/channel/state/State.java +++ b/src/main/java/io/github/dsheirer/channel/state/State.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package channel.state; +package io.github.dsheirer.channel.state; import java.util.EnumSet; diff --git a/src/channel/traffic/TrafficChannelAllocationEvent.java b/src/main/java/io/github/dsheirer/channel/traffic/TrafficChannelAllocationEvent.java similarity index 87% rename from src/channel/traffic/TrafficChannelAllocationEvent.java rename to src/main/java/io/github/dsheirer/channel/traffic/TrafficChannelAllocationEvent.java index 87b7b0b9..935e60e9 100644 --- a/src/channel/traffic/TrafficChannelAllocationEvent.java +++ b/src/main/java/io/github/dsheirer/channel/traffic/TrafficChannelAllocationEvent.java @@ -16,16 +16,16 @@ * along with this program. If not, see * ******************************************************************************/ -package channel.traffic; +package io.github.dsheirer.channel.traffic; -import channel.state.DecoderStateEvent; -import channel.state.State; -import module.decode.event.CallEvent; +import io.github.dsheirer.channel.state.DecoderStateEvent; +import io.github.dsheirer.channel.state.State; +import io.github.dsheirer.module.decode.event.CallEvent; /** * Traffic channel allocation event wraps a call event indicating the channel * and frequency for a traffic channel allocation event, so that the traffic - * channel manager can respond and allocate a decoder channel and source if + * channel manager can respond and allocate a decoder channel and source if * available, or change the wrapped call event to a call detect event and log it. */ public class TrafficChannelAllocationEvent extends DecoderStateEvent diff --git a/src/channel/traffic/TrafficChannelManager.java b/src/main/java/io/github/dsheirer/channel/traffic/TrafficChannelManager.java similarity index 90% rename from src/channel/traffic/TrafficChannelManager.java rename to src/main/java/io/github/dsheirer/channel/traffic/TrafficChannelManager.java index c374df43..dcd12ce5 100644 --- a/src/channel/traffic/TrafficChannelManager.java +++ b/src/main/java/io/github/dsheirer/channel/traffic/TrafficChannelManager.java @@ -16,29 +16,28 @@ * along with this program. If not, see * ******************************************************************************/ -package channel.traffic; +package io.github.dsheirer.channel.traffic; -import channel.state.DecoderStateEvent; -import channel.state.IDecoderStateEventListener; -import controller.channel.Channel; -import controller.channel.Channel.ChannelType; -import controller.channel.ChannelEvent; -import controller.channel.ChannelEvent.Event; -import controller.channel.ChannelModel; -import controller.channel.TrafficChannelEvent; -import module.Module; -import module.decode.config.DecodeConfiguration; -import module.decode.event.CallEvent; -import module.decode.event.CallEvent.CallEventType; -import module.decode.event.ICallEventProvider; -import module.log.config.EventLogConfiguration; +import io.github.dsheirer.channel.state.DecoderStateEvent; +import io.github.dsheirer.channel.state.IDecoderStateEventListener; +import io.github.dsheirer.controller.channel.Channel; +import io.github.dsheirer.controller.channel.Channel.ChannelType; +import io.github.dsheirer.controller.channel.ChannelEvent; +import io.github.dsheirer.controller.channel.ChannelEvent.Event; +import io.github.dsheirer.controller.channel.ChannelModel; +import io.github.dsheirer.controller.channel.TrafficChannelEvent; +import io.github.dsheirer.module.Module; +import io.github.dsheirer.module.decode.config.DecodeConfiguration; +import io.github.dsheirer.module.decode.event.CallEvent; +import io.github.dsheirer.module.decode.event.ICallEventProvider; +import io.github.dsheirer.module.log.config.EventLogConfiguration; +import io.github.dsheirer.record.config.RecordConfiguration; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.source.config.SourceConfigTuner; +import io.github.dsheirer.source.tuner.TunerChannel; +import io.github.dsheirer.source.tuner.TunerChannel.Type; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import record.config.RecordConfiguration; -import sample.Listener; -import source.config.SourceConfigTuner; -import source.tuner.TunerChannel; -import source.tuner.TunerChannel.Type; import java.util.ArrayList; import java.util.List; @@ -214,7 +213,7 @@ public class TrafficChannelManager extends Module implements ICallEventProvider, } else { - callEvent.setCallEventType(CallEventType.CALL_DETECT); + callEvent.setCallEventType(CallEvent.CallEventType.CALL_DETECT); String details = callEvent.getDetails(); @@ -231,7 +230,7 @@ public class TrafficChannelManager extends Module implements ICallEventProvider, } else { - callEvent.setCallEventType(CallEventType.CALL_DETECT); + callEvent.setCallEventType(CallEvent.CallEventType.CALL_DETECT); String details = callEvent.getDetails(); @@ -248,7 +247,7 @@ public class TrafficChannelManager extends Module implements ICallEventProvider, } else { - callEvent.setCallEventType(CallEventType.CALL_DETECT); + callEvent.setCallEventType(CallEvent.CallEventType.CALL_DETECT); String details = callEvent.getDetails(); diff --git a/src/controller/ControllerPanel.java b/src/main/java/io/github/dsheirer/controller/ControllerPanel.java similarity index 79% rename from src/controller/ControllerPanel.java rename to src/main/java/io/github/dsheirer/controller/ControllerPanel.java index 9b3f6cd3..95bcd3d3 100644 --- a/src/controller/ControllerPanel.java +++ b/src/main/java/io/github/dsheirer/controller/ControllerPanel.java @@ -16,30 +16,28 @@ * along with this program. If not, see * ******************************************************************************/ -package controller; +package io.github.dsheirer.controller; -import alias.AliasController; -import alias.AliasModel; -import audio.AudioManager; -import audio.AudioPanel; -import audio.broadcast.BroadcastModel; -import audio.broadcast.BroadcastPanel; -import audio.broadcast.BroadcastStatusPanel; -import channel.metadata.ChannelMetadataViewer; import com.jidesoft.swing.JideTabbedPane; -import controller.channel.ChannelController; -import controller.channel.ChannelModel; -import controller.channel.ChannelProcessingManager; -import controller.channel.map.ChannelMapModel; -import icon.IconManager; -import map.MapPanel; -import map.MapService; +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; +import io.github.dsheirer.audio.broadcast.BroadcastPanel; +import io.github.dsheirer.channel.metadata.ChannelMetadataViewer; +import io.github.dsheirer.controller.channel.ChannelController; +import io.github.dsheirer.controller.channel.ChannelModel; +import io.github.dsheirer.controller.channel.ChannelProcessingManager; +import io.github.dsheirer.controller.channel.map.ChannelMapModel; +import io.github.dsheirer.icon.IconManager; +import io.github.dsheirer.map.MapPanel; +import io.github.dsheirer.map.MapService; +import io.github.dsheirer.settings.SettingsManager; +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 properties.SystemProperties; -import settings.SettingsManager; -import source.SourceManager; -import source.tuner.TunerModel; -import source.tuner.TunerViewPanel; import javax.swing.*; import java.awt.*; diff --git a/src/controller/NamingThreadFactory.java b/src/main/java/io/github/dsheirer/controller/NamingThreadFactory.java similarity index 95% rename from src/controller/NamingThreadFactory.java rename to src/main/java/io/github/dsheirer/controller/NamingThreadFactory.java index ed7bd0dc..b8ef09a5 100644 --- a/src/controller/NamingThreadFactory.java +++ b/src/main/java/io/github/dsheirer/controller/NamingThreadFactory.java @@ -1,8 +1,8 @@ -package controller; +package io.github.dsheirer.controller; +import io.github.dsheirer.util.ThreadPool; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import util.ThreadPool; import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicInteger; diff --git a/src/controller/channel/Channel.java b/src/main/java/io/github/dsheirer/controller/channel/Channel.java similarity index 80% rename from src/controller/channel/Channel.java rename to src/main/java/io/github/dsheirer/controller/channel/Channel.java index 79be174b..9c0cee7f 100644 --- a/src/controller/channel/Channel.java +++ b/src/main/java/io/github/dsheirer/controller/channel/Channel.java @@ -16,46 +16,36 @@ * along with this program. If not, see * ******************************************************************************/ -package controller.channel; +package io.github.dsheirer.controller.channel; -import controller.config.Configuration; -import module.decode.DecoderFactory; -import module.decode.DecoderType; -import module.decode.config.AuxDecodeConfiguration; -import module.decode.config.DecodeConfiguration; -import module.log.EventLogType; -import module.log.config.EventLogConfiguration; -import record.RecorderType; -import record.config.RecordConfiguration; -import sample.Listener; -import source.SourceType; -import source.config.SourceConfigFactory; -import source.config.SourceConfigRecording; -import source.config.SourceConfigTuner; -import source.config.SourceConfiguration; -import source.tuner.TunerChannel; -import source.tuner.TunerChannel.Type; -import source.tuner.frequency.FrequencyChangeEvent; -import source.tuner.frequency.FrequencyChangeEvent.Event; +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; +import io.github.dsheirer.module.decode.config.AuxDecodeConfiguration; +import io.github.dsheirer.module.decode.config.DecodeConfiguration; +import io.github.dsheirer.module.log.EventLogType; +import io.github.dsheirer.module.log.config.EventLogConfiguration; +import io.github.dsheirer.record.RecorderType; +import io.github.dsheirer.record.config.RecordConfiguration; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.source.SourceType; +import io.github.dsheirer.source.config.SourceConfigFactory; +import io.github.dsheirer.source.config.SourceConfigRecording; +import io.github.dsheirer.source.config.SourceConfigTuner; +import io.github.dsheirer.source.config.SourceConfiguration; +import io.github.dsheirer.source.tuner.TunerChannel; +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 { // 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 ******************************************************************************/ -package controller.channel; - -import gui.editor.Editor; -import gui.editor.EditorValidationException; - -import java.awt.Color; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.JButton; -import javax.swing.JLabel; -import javax.swing.JOptionPane; - -import module.decode.AuxDecodeConfigurationEditor; -import module.decode.DecodeConfigurationEditor; -import module.log.EventLogConfigurationEditor; -import net.miginfocom.swing.MigLayout; -import record.RecordConfigurationEditor; -import source.SourceConfigurationEditor; -import source.SourceManager; -import alias.AliasModel; +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 controller.channel.ChannelEvent.Event; -import controller.channel.map.ChannelMapModel; +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; public class ChannelEditor extends Editor implements ActionListener, ChannelEventListener { @@ -170,14 +163,14 @@ public class ChannelEditor extends Editor implements ActionListener, Ch save(); mChannelEnableRequested = true; - mChannelModel.broadcast( new ChannelEvent( getItem(), Event.REQUEST_ENABLE ) ); + mChannelModel.broadcast( new ChannelEvent( getItem(), ChannelEvent.Event.REQUEST_ENABLE ) ); } } else if( command.contentEquals( "Disable" ) ) { if( hasItem() ) { - mChannelModel.broadcast( new ChannelEvent( getItem(), Event.REQUEST_DISABLE ) ); + mChannelModel.broadcast( new ChannelEvent( getItem(), ChannelEvent.Event.REQUEST_DISABLE ) ); } } else if( command.contentEquals( "Save" ) ) @@ -249,7 +242,7 @@ public class ChannelEditor extends Editor implements ActionListener, Ch mChannelModel.broadcast( new ChannelEvent( getItem(), - Event.NOTIFICATION_CONFIGURATION_CHANGE ) ); + ChannelEvent.Event.NOTIFICATION_CONFIGURATION_CHANGE ) ); } setModified( false ); diff --git a/src/controller/channel/ChannelEvent.java b/src/main/java/io/github/dsheirer/controller/channel/ChannelEvent.java similarity index 98% rename from src/controller/channel/ChannelEvent.java rename to src/main/java/io/github/dsheirer/controller/channel/ChannelEvent.java index b71b5c94..fc778521 100644 --- a/src/controller/channel/ChannelEvent.java +++ b/src/main/java/io/github/dsheirer/controller/channel/ChannelEvent.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package controller.channel; +package io.github.dsheirer.controller.channel; public class ChannelEvent { diff --git a/src/controller/channel/ChannelEventListener.java b/src/main/java/io/github/dsheirer/controller/channel/ChannelEventListener.java similarity index 96% rename from src/controller/channel/ChannelEventListener.java rename to src/main/java/io/github/dsheirer/controller/channel/ChannelEventListener.java index ad223435..0e0e8674 100644 --- a/src/controller/channel/ChannelEventListener.java +++ b/src/main/java/io/github/dsheirer/controller/channel/ChannelEventListener.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package controller.channel; +package io.github.dsheirer.controller.channel; /** * Interface for receiving channel events. Each listener will receive diff --git a/src/controller/channel/ChannelModel.java b/src/main/java/io/github/dsheirer/controller/channel/ChannelModel.java similarity index 97% rename from src/controller/channel/ChannelModel.java rename to src/main/java/io/github/dsheirer/controller/channel/ChannelModel.java index d7b87ca8..8b0d2516 100644 --- a/src/controller/channel/ChannelModel.java +++ b/src/main/java/io/github/dsheirer/controller/channel/ChannelModel.java @@ -16,11 +16,11 @@ * along with this program. If not, see * ******************************************************************************/ -package controller.channel; +package io.github.dsheirer.controller.channel; -import controller.channel.Channel.ChannelType; -import controller.channel.ChannelEvent.Event; -import module.decode.DecoderType; +import io.github.dsheirer.controller.channel.Channel.ChannelType; +import io.github.dsheirer.controller.channel.ChannelEvent.Event; +import io.github.dsheirer.module.decode.DecoderType; import javax.swing.table.AbstractTableModel; import java.util.ArrayList; diff --git a/src/controller/channel/ChannelProcessingManager.java b/src/main/java/io/github/dsheirer/controller/channel/ChannelProcessingManager.java similarity index 88% rename from src/controller/channel/ChannelProcessingManager.java rename to src/main/java/io/github/dsheirer/controller/channel/ChannelProcessingManager.java index ad65bd3c..ee4a232d 100644 --- a/src/controller/channel/ChannelProcessingManager.java +++ b/src/main/java/io/github/dsheirer/controller/channel/ChannelProcessingManager.java @@ -16,34 +16,32 @@ * along with this program. If not, see * ******************************************************************************/ -package controller.channel; +package io.github.dsheirer.controller.channel; -import alias.AliasModel; -import audio.AudioPacket; -import channel.metadata.Attribute; -import channel.metadata.AttributeChangeRequest; -import channel.metadata.ChannelMetadataModel; -import controller.channel.Channel.ChannelType; -import controller.channel.ChannelEvent.Event; -import controller.channel.map.ChannelMapModel; -import filter.FilterSet; -import message.Message; -import module.Module; -import module.ProcessingChain; -import module.decode.DecoderFactory; -import module.decode.DecoderType; -import module.decode.event.MessageActivityModel; -import module.log.EventLogManager; +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; +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; +import io.github.dsheirer.source.Source; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.SourceManager; +import io.github.dsheirer.source.SourceType; +import io.github.dsheirer.source.config.SourceConfigTuner; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import record.RecorderManager; -import record.RecorderType; -import sample.Listener; -import source.Source; -import source.SourceException; -import source.SourceManager; -import source.SourceType; -import source.config.SourceConfigTuner; import java.util.HashMap; import java.util.List; @@ -224,7 +222,7 @@ public class ChannelProcessingManager implements ChannelEventListener { channel.setEnabled(false); - mChannelModel.broadcast(new ChannelEvent(channel, Event.NOTIFICATION_ENABLE_REJECTED)); + mChannelModel.broadcast(new ChannelEvent(channel, ChannelEvent.Event.NOTIFICATION_ENABLE_REJECTED)); return; } @@ -299,14 +297,14 @@ public class ChannelProcessingManager implements ChannelEventListener if(!recorders.isEmpty()) { - /* Add baseband recorder */ - if((recorders.contains(RecorderType.BASEBAND) && channel.getChannelType() == ChannelType.STANDARD)) + /* Add baseband recorder */ + if((recorders.contains(RecorderType.BASEBAND) && channel.getChannelType() == Channel.ChannelType.STANDARD)) { processingChain.addModule(mRecorderManager.getBasebandRecorder(channel.toString())); } - /* Add traffic channel baseband recorder */ - if(recorders.contains(RecorderType.TRAFFIC_BASEBAND) && channel.getChannelType() == ChannelType.TRAFFIC) + /* Add traffic channel baseband recorder */ + if(recorders.contains(RecorderType.TRAFFIC_BASEBAND) && channel.getChannelType() == Channel.ChannelType.TRAFFIC) { processingChain.addModule(mRecorderManager.getBasebandRecorder(channel.toString())); } @@ -331,7 +329,7 @@ public class ChannelProcessingManager implements ChannelEventListener mProcessingChains.put(channel.getChannelID(), processingChain); - mChannelModel.broadcast(new ChannelEvent(channel, Event.NOTIFICATION_PROCESSING_START)); + mChannelModel.broadcast(new ChannelEvent(channel, ChannelEvent.Event.NOTIFICATION_PROCESSING_START)); } private void stopProcessing(Channel channel, boolean remove) @@ -354,7 +352,7 @@ public class ChannelProcessingManager implements ChannelEventListener processingChain.removeFrequencyChangeListener(channel); channel.resetFrequencyCorrection(); - mChannelModel.broadcast(new ChannelEvent(channel, Event.NOTIFICATION_PROCESSING_STOP)); + mChannelModel.broadcast(new ChannelEvent(channel, ChannelEvent.Event.NOTIFICATION_PROCESSING_STOP)); if(remove) { diff --git a/src/controller/channel/ChannelSelectionManager.java b/src/main/java/io/github/dsheirer/controller/channel/ChannelSelectionManager.java similarity index 90% rename from src/controller/channel/ChannelSelectionManager.java rename to src/main/java/io/github/dsheirer/controller/channel/ChannelSelectionManager.java index 65ac9b91..05c9fd4a 100644 --- a/src/controller/channel/ChannelSelectionManager.java +++ b/src/main/java/io/github/dsheirer/controller/channel/ChannelSelectionManager.java @@ -15,9 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package controller.channel; - -import controller.channel.ChannelEvent.Event; +package io.github.dsheirer.controller.channel; public class ChannelSelectionManager implements ChannelEventListener { @@ -43,14 +41,14 @@ public class ChannelSelectionManager implements ChannelEventListener { mSelectedChannel.setSelected( false ); mChannelEventBroadcaster.broadcast( new ChannelEvent( mSelectedChannel, - Event.NOTIFICATION_SELECTION_CHANGE ) ); + ChannelEvent.Event.NOTIFICATION_SELECTION_CHANGE ) ); mSelectedChannel = null; } mSelectedChannel = event.getChannel(); mSelectedChannel.setSelected( true ); mChannelEventBroadcaster.broadcast( new ChannelEvent( event.getChannel(), - Event.NOTIFICATION_SELECTION_CHANGE ) ); + ChannelEvent.Event.NOTIFICATION_SELECTION_CHANGE ) ); break; case NOTIFICATION_PROCESSING_STOP: case REQUEST_DESELECT: @@ -60,7 +58,7 @@ public class ChannelSelectionManager implements ChannelEventListener mSelectedChannel.setSelected( false ); mSelectedChannel = null; mChannelEventBroadcaster.broadcast( new ChannelEvent( event.getChannel(), - Event.NOTIFICATION_SELECTION_CHANGE ) ); + ChannelEvent.Event.NOTIFICATION_SELECTION_CHANGE ) ); } break; default: diff --git a/src/controller/channel/ChannelUtils.java b/src/main/java/io/github/dsheirer/controller/channel/ChannelUtils.java similarity index 82% rename from src/controller/channel/ChannelUtils.java rename to src/main/java/io/github/dsheirer/controller/channel/ChannelUtils.java index c595dac3..657b65e4 100644 --- a/src/controller/channel/ChannelUtils.java +++ b/src/main/java/io/github/dsheirer/controller/channel/ChannelUtils.java @@ -1,19 +1,14 @@ -package controller.channel; +package io.github.dsheirer.controller.channel; -import java.awt.Component; +import io.github.dsheirer.channel.state.DecoderState; +import io.github.dsheirer.module.ProcessingChain; +import io.github.dsheirer.module.decode.event.ActivitySummaryFrame; + +import javax.swing.*; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import javax.swing.JMenu; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JSeparator; - -import module.ProcessingChain; -import module.decode.event.ActivitySummaryFrame; -import channel.state.DecoderState; -import controller.channel.ChannelEvent.Event; - public class ChannelUtils { /** @@ -37,7 +32,7 @@ public class ChannelUtils public void actionPerformed( ActionEvent e ) { channelModel.broadcast( - new ChannelEvent( channel, Event.REQUEST_DISABLE ) ); + new ChannelEvent( channel, ChannelEvent.Event.REQUEST_DISABLE ) ); } } ); @@ -80,7 +75,7 @@ public class ChannelUtils public void actionPerformed( ActionEvent e ) { channelModel.broadcast( - new ChannelEvent( channel, Event.REQUEST_ENABLE ) ); + new ChannelEvent( channel, ChannelEvent.Event.REQUEST_ENABLE ) ); } } ); @@ -102,7 +97,7 @@ public class ChannelUtils if( response == JOptionPane.YES_OPTION ) { channelModel.broadcast( - new ChannelEvent( channel, Event.REQUEST_DELETE ) ); + new ChannelEvent( channel, ChannelEvent.Event.REQUEST_DELETE ) ); } } } ); diff --git a/src/controller/channel/ConfigurationValidationException.java b/src/main/java/io/github/dsheirer/controller/channel/ConfigurationValidationException.java similarity index 85% rename from src/controller/channel/ConfigurationValidationException.java rename to src/main/java/io/github/dsheirer/controller/channel/ConfigurationValidationException.java index a61862c5..66439e8c 100644 --- a/src/controller/channel/ConfigurationValidationException.java +++ b/src/main/java/io/github/dsheirer/controller/channel/ConfigurationValidationException.java @@ -1,6 +1,6 @@ -package controller.channel; +package io.github.dsheirer.controller.channel; -import java.awt.Component; +import java.awt.*; public class ConfigurationValidationException extends Exception { diff --git a/src/controller/channel/IChannelEventBroadcaster.java b/src/main/java/io/github/dsheirer/controller/channel/IChannelEventBroadcaster.java similarity index 95% rename from src/controller/channel/IChannelEventBroadcaster.java rename to src/main/java/io/github/dsheirer/controller/channel/IChannelEventBroadcaster.java index ef7c89fd..2b365072 100644 --- a/src/controller/channel/IChannelEventBroadcaster.java +++ b/src/main/java/io/github/dsheirer/controller/channel/IChannelEventBroadcaster.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package controller.channel; +package io.github.dsheirer.controller.channel; /** * Provides channel event broadcasting capability. diff --git a/src/controller/channel/IChannelEventListener.java b/src/main/java/io/github/dsheirer/controller/channel/IChannelEventListener.java similarity index 53% rename from src/controller/channel/IChannelEventListener.java rename to src/main/java/io/github/dsheirer/controller/channel/IChannelEventListener.java index 3ec41b53..0ffb6ff0 100644 --- a/src/controller/channel/IChannelEventListener.java +++ b/src/main/java/io/github/dsheirer/controller/channel/IChannelEventListener.java @@ -1,6 +1,6 @@ -package controller.channel; +package io.github.dsheirer.controller.channel; -import sample.Listener; +import io.github.dsheirer.sample.Listener; public interface IChannelEventListener { diff --git a/src/controller/channel/IChannelEventProvider.java b/src/main/java/io/github/dsheirer/controller/channel/IChannelEventProvider.java similarity index 64% rename from src/controller/channel/IChannelEventProvider.java rename to src/main/java/io/github/dsheirer/controller/channel/IChannelEventProvider.java index 330e22ab..d6acb8ad 100644 --- a/src/controller/channel/IChannelEventProvider.java +++ b/src/main/java/io/github/dsheirer/controller/channel/IChannelEventProvider.java @@ -1,6 +1,6 @@ -package controller.channel; +package io.github.dsheirer.controller.channel; -import sample.Listener; +import io.github.dsheirer.sample.Listener; public interface IChannelEventProvider { diff --git a/src/controller/channel/NameConfigurationEditor.java b/src/main/java/io/github/dsheirer/controller/channel/NameConfigurationEditor.java similarity index 98% rename from src/controller/channel/NameConfigurationEditor.java rename to src/main/java/io/github/dsheirer/controller/channel/NameConfigurationEditor.java index fc8961de..9d07aa73 100644 --- a/src/controller/channel/NameConfigurationEditor.java +++ b/src/main/java/io/github/dsheirer/controller/channel/NameConfigurationEditor.java @@ -15,10 +15,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package controller.channel; +package io.github.dsheirer.controller.channel; -import alias.AliasModel; -import gui.editor.Editor; +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; diff --git a/src/controller/channel/TrafficChannelEvent.java b/src/main/java/io/github/dsheirer/controller/channel/TrafficChannelEvent.java similarity index 79% rename from src/controller/channel/TrafficChannelEvent.java rename to src/main/java/io/github/dsheirer/controller/channel/TrafficChannelEvent.java index 8679c549..f00ddcc4 100644 --- a/src/controller/channel/TrafficChannelEvent.java +++ b/src/main/java/io/github/dsheirer/controller/channel/TrafficChannelEvent.java @@ -1,7 +1,7 @@ -package controller.channel; +package io.github.dsheirer.controller.channel; -import module.decode.event.CallEvent; -import channel.traffic.TrafficChannelManager; +import io.github.dsheirer.channel.traffic.TrafficChannelManager; +import io.github.dsheirer.module.decode.event.CallEvent; public class TrafficChannelEvent extends ChannelEvent { diff --git a/src/main/java/io/github/dsheirer/controller/channel/map/ChannelMap.java b/src/main/java/io/github/dsheirer/controller/channel/map/ChannelMap.java new file mode 100644 index 00000000..1918f6d6 --- /dev/null +++ b/src/main/java/io/github/dsheirer/controller/channel/map/ChannelMap.java @@ -0,0 +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 + ******************************************************************************/ +package io.github.dsheirer.controller.channel.map; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; + +import java.util.ArrayList; +import java.util.List; + +public class ChannelMap +{ + private String mName; + private boolean mInvalid = false; + + private List mRanges = new ArrayList(); + + 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; + } + + @JsonIgnore + public boolean isInvalid() + { + return mInvalid; + } + + public String toString() + { + return mName + (mInvalid ? " - Error" : ""); + } + + @JacksonXmlProperty(isAttribute = false, localName = "range") + public List getRanges() + { + return mRanges; + } + + public void setRanges(List 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(); + } + +} diff --git a/src/controller/channel/map/ChannelMapEditor.java b/src/main/java/io/github/dsheirer/controller/channel/map/ChannelMapEditor.java similarity index 92% rename from src/controller/channel/map/ChannelMapEditor.java rename to src/main/java/io/github/dsheirer/controller/channel/map/ChannelMapEditor.java index ef7c4374..b91c0f00 100644 --- a/src/controller/channel/map/ChannelMapEditor.java +++ b/src/main/java/io/github/dsheirer/controller/channel/map/ChannelMapEditor.java @@ -15,32 +15,21 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package controller.channel.map; +package io.github.dsheirer.controller.channel.map; -import gui.editor.DocumentListenerEditor; +import io.github.dsheirer.controller.channel.map.ChannelMapEvent.Event; +import io.github.dsheirer.controller.channel.map.ChannelRangeModel.ChannelRangeEventListener; +import io.github.dsheirer.gui.editor.DocumentListenerEditor; +import net.miginfocom.swing.MigLayout; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.AbstractCellEditor; -import javax.swing.JButton; -import javax.swing.JFormattedTextField; -import javax.swing.JLabel; -import javax.swing.JList; -import javax.swing.JOptionPane; -import javax.swing.JScrollPane; -import javax.swing.JTable; -import javax.swing.JTextField; +import javax.swing.*; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.table.TableCellEditor; import javax.swing.text.InternationalFormatter; - -import net.miginfocom.swing.MigLayout; -import controller.channel.map.ChannelMapEvent.Event; -import controller.channel.map.ChannelRangeModel.ChannelRangeEventListener; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; public class ChannelMapEditor extends DocumentListenerEditor implements ListSelectionListener, ChannelRangeEventListener @@ -215,7 +204,7 @@ public class ChannelMapEditor extends DocumentListenerEditor if( selectedRange != null ) { int choice = JOptionPane.showConfirmDialog( mRangeTable, - "Do you want to delete this channel range?", + "Do you want to delete this channel range?", "Delete Channel Range?", JOptionPane.YES_NO_OPTION ); if( choice == JOptionPane.YES_OPTION ) diff --git a/src/controller/channel/map/ChannelMapEvent.java b/src/main/java/io/github/dsheirer/controller/channel/map/ChannelMapEvent.java similarity index 97% rename from src/controller/channel/map/ChannelMapEvent.java rename to src/main/java/io/github/dsheirer/controller/channel/map/ChannelMapEvent.java index a3ca8821..dde170f2 100644 --- a/src/controller/channel/map/ChannelMapEvent.java +++ b/src/main/java/io/github/dsheirer/controller/channel/map/ChannelMapEvent.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package controller.channel.map; +package io.github.dsheirer.controller.channel.map; public class ChannelMapEvent { diff --git a/src/controller/channel/map/ChannelMapManager.java b/src/main/java/io/github/dsheirer/controller/channel/map/ChannelMapManager.java similarity index 92% rename from src/controller/channel/map/ChannelMapManager.java rename to src/main/java/io/github/dsheirer/controller/channel/map/ChannelMapManager.java index 78e0608e..e03ccc76 100644 --- a/src/controller/channel/map/ChannelMapManager.java +++ b/src/main/java/io/github/dsheirer/controller/channel/map/ChannelMapManager.java @@ -1,20 +1,13 @@ -package controller.channel.map; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.JButton; -import javax.swing.JList; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.ListSelectionModel; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; - -import net.miginfocom.swing.MigLayout; +package io.github.dsheirer.controller.channel.map; import com.jidesoft.swing.JideSplitPane; +import net.miginfocom.swing.MigLayout; + +import javax.swing.*; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; public class ChannelMapManager extends JPanel { @@ -111,7 +104,7 @@ public class ChannelMapManager extends JPanel if( channelMap != null ) { int choice = JOptionPane.showConfirmDialog( mChannelMapList, - "Do you want to delete this channel map?", + "Do you want to delete this channel map?", "Delete Channel Map?", JOptionPane.YES_NO_OPTION ); if( choice == JOptionPane.YES_OPTION ) diff --git a/src/controller/channel/map/ChannelMapManagerFrame.java b/src/main/java/io/github/dsheirer/controller/channel/map/ChannelMapManagerFrame.java similarity index 95% rename from src/controller/channel/map/ChannelMapManagerFrame.java rename to src/main/java/io/github/dsheirer/controller/channel/map/ChannelMapManagerFrame.java index 04812979..c09651be 100644 --- a/src/controller/channel/map/ChannelMapManagerFrame.java +++ b/src/main/java/io/github/dsheirer/controller/channel/map/ChannelMapManagerFrame.java @@ -15,14 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package controller.channel.map; - -import java.awt.EventQueue; - -import javax.swing.JFrame; +package io.github.dsheirer.controller.channel.map; import net.miginfocom.swing.MigLayout; +import javax.swing.*; +import java.awt.*; + public class ChannelMapManagerFrame extends JFrame { private static final long serialVersionUID = 1L; diff --git a/src/controller/channel/map/ChannelMapModel.java b/src/main/java/io/github/dsheirer/controller/channel/map/ChannelMapModel.java similarity index 94% rename from src/controller/channel/map/ChannelMapModel.java rename to src/main/java/io/github/dsheirer/controller/channel/map/ChannelMapModel.java index 5b0cbce1..9f2d114d 100644 --- a/src/controller/channel/map/ChannelMapModel.java +++ b/src/main/java/io/github/dsheirer/controller/channel/map/ChannelMapModel.java @@ -1,10 +1,10 @@ -package controller.channel.map; +package io.github.dsheirer.controller.channel.map; -import controller.channel.map.ChannelMapEvent.Event; +import io.github.dsheirer.controller.channel.map.ChannelMapEvent.Event; +import io.github.dsheirer.sample.Broadcaster; +import io.github.dsheirer.sample.Listener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Broadcaster; -import sample.Listener; import javax.swing.*; import java.util.ArrayList; diff --git a/src/main/java/io/github/dsheirer/controller/channel/map/ChannelRange.java b/src/main/java/io/github/dsheirer/controller/channel/map/ChannelRange.java new file mode 100644 index 00000000..35ba0440 --- /dev/null +++ b/src/main/java/io/github/dsheirer/controller/channel/map/ChannelRange.java @@ -0,0 +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 + ******************************************************************************/ +package io.github.dsheirer.controller.channel.map; + +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; + +@JacksonXmlRootElement(localName = "range") +public class ChannelRange +{ + 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; + + public ChannelRange() + { + } + + public ChannelRange(int first, int last, int base, int size) + { + mFirst = first; + mLast = last; + mBase = base; + mSize = size; + } + + public ChannelRange copyOf() + { + return new ChannelRange(mFirst, mLast, mBase, mSize); + } + + @JsonIgnore + 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!"); + } + + 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; + } +} diff --git a/src/controller/channel/map/ChannelRangeModel.java b/src/main/java/io/github/dsheirer/controller/channel/map/ChannelRangeModel.java similarity index 99% rename from src/controller/channel/map/ChannelRangeModel.java rename to src/main/java/io/github/dsheirer/controller/channel/map/ChannelRangeModel.java index 91d6c29f..9ae29b46 100644 --- a/src/controller/channel/map/ChannelRangeModel.java +++ b/src/main/java/io/github/dsheirer/controller/channel/map/ChannelRangeModel.java @@ -15,12 +15,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package controller.channel.map; - -import java.util.List; -import java.util.concurrent.CopyOnWriteArrayList; +package io.github.dsheirer.controller.channel.map; import javax.swing.table.AbstractTableModel; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; public class ChannelRangeModel extends AbstractTableModel { diff --git a/src/module/decode/nbfm/DecodeConfigNBFM.java b/src/main/java/io/github/dsheirer/controller/config/Configuration.java similarity index 78% rename from src/module/decode/nbfm/DecodeConfigNBFM.java rename to src/main/java/io/github/dsheirer/controller/config/Configuration.java index 8d1b5b90..6b639977 100644 --- a/src/module/decode/nbfm/DecodeConfigNBFM.java +++ b/src/main/java/io/github/dsheirer/controller/config/Configuration.java @@ -1,29 +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 ******************************************************************************/ -package module.decode.nbfm; +package io.github.dsheirer.controller.config; -import module.decode.DecoderType; -import module.decode.config.DecodeConfiguration; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -public class DecodeConfigNBFM extends DecodeConfiguration +@JacksonXmlRootElement(localName = "configuration") +public abstract class Configuration { - public DecodeConfigNBFM() + public Configuration() { - super( DecoderType.NBFM ); } } diff --git a/src/dsp/NRZDecoder.java b/src/main/java/io/github/dsheirer/dsp/NRZDecoder.java similarity index 96% rename from src/dsp/NRZDecoder.java rename to src/main/java/io/github/dsheirer/dsp/NRZDecoder.java index d8d30073..2c1e9e68 100644 --- a/src/dsp/NRZDecoder.java +++ b/src/main/java/io/github/dsheirer/dsp/NRZDecoder.java @@ -15,9 +15,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp; +package io.github.dsheirer.dsp; -import sample.Listener; +import io.github.dsheirer.sample.Listener; public class NRZDecoder implements Listener { diff --git a/src/dsp/am/AMDemodulator.java b/src/main/java/io/github/dsheirer/dsp/am/AMDemodulator.java similarity index 90% rename from src/dsp/am/AMDemodulator.java rename to src/main/java/io/github/dsheirer/dsp/am/AMDemodulator.java index 261adc80..045d748f 100644 --- a/src/dsp/am/AMDemodulator.java +++ b/src/main/java/io/github/dsheirer/dsp/am/AMDemodulator.java @@ -1,22 +1,22 @@ -package dsp.am; - -public abstract class AMDemodulator -{ - private float mGain; - - public AMDemodulator( float gain ) - { - mGain = gain; - } - - public float demodulate( float inphase, float quadrature ) - { - return (float)Math.sqrt( ( inphase * inphase ) + - ( quadrature * quadrature ) ) * mGain; - } - - public void setGain( float gain ) - { - mGain = gain; - } -} +package io.github.dsheirer.dsp.am; + +public abstract class AMDemodulator +{ + private float mGain; + + public AMDemodulator( float gain ) + { + mGain = gain; + } + + public float demodulate( float inphase, float quadrature ) + { + return (float)Math.sqrt( ( inphase * inphase ) + + ( quadrature * quadrature ) ) * mGain; + } + + public void setGain( float gain ) + { + mGain = gain; + } +} diff --git a/src/dsp/am/AMDemodulator_CB.java b/src/main/java/io/github/dsheirer/dsp/am/AMDemodulator_CB.java similarity index 90% rename from src/dsp/am/AMDemodulator_CB.java rename to src/main/java/io/github/dsheirer/dsp/am/AMDemodulator_CB.java index 543dff37..4a22ba6b 100644 --- a/src/dsp/am/AMDemodulator_CB.java +++ b/src/main/java/io/github/dsheirer/dsp/am/AMDemodulator_CB.java @@ -15,11 +15,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.am; +package io.github.dsheirer.dsp.am; -import sample.Listener; -import sample.complex.ComplexBuffer; -import sample.real.RealBuffer; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.ComplexBuffer; +import io.github.dsheirer.sample.real.RealBuffer; public class AMDemodulator_CB extends AMDemodulator implements Listener { diff --git a/src/dsp/filter/BooleanAveragingFilter.java b/src/main/java/io/github/dsheirer/dsp/filter/BooleanAveragingFilter.java similarity index 95% rename from src/dsp/filter/BooleanAveragingFilter.java rename to src/main/java/io/github/dsheirer/dsp/filter/BooleanAveragingFilter.java index 5c0fe09f..e5fbecb2 100644 --- a/src/dsp/filter/BooleanAveragingFilter.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/BooleanAveragingFilter.java @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.filter; +package io.github.dsheirer.dsp.filter; + +import io.github.dsheirer.sample.Listener; import java.util.BitSet; -import sample.Listener; - /** * Averages (low pass filter) boolean values over the defined size */ diff --git a/src/dsp/filter/ComplexFilter.java b/src/main/java/io/github/dsheirer/dsp/filter/ComplexFilter.java similarity index 91% rename from src/dsp/filter/ComplexFilter.java rename to src/main/java/io/github/dsheirer/dsp/filter/ComplexFilter.java index b5e08191..59b9abb9 100644 --- a/src/dsp/filter/ComplexFilter.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/ComplexFilter.java @@ -15,10 +15,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.filter; +package io.github.dsheirer.dsp.filter; -import sample.Listener; -import sample.complex.Complex; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.Complex; @Deprecated public abstract class ComplexFilter implements Listener diff --git a/src/dsp/filter/FilterFactory.java b/src/main/java/io/github/dsheirer/dsp/filter/FilterFactory.java similarity index 97% rename from src/dsp/filter/FilterFactory.java rename to src/main/java/io/github/dsheirer/dsp/filter/FilterFactory.java index 5ca5a078..01706df0 100644 --- a/src/dsp/filter/FilterFactory.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/FilterFactory.java @@ -20,13 +20,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.filter; +package io.github.dsheirer.dsp.filter; -import dsp.filter.Window.WindowType; -import dsp.filter.cic.ComplexPrimeCICDecimate; -import dsp.filter.design.FilterDesignException; -import dsp.filter.fir.FIRFilterSpecification; -import dsp.filter.fir.remez.RemezFIRFilterDesigner; +import io.github.dsheirer.dsp.filter.cic.ComplexPrimeCICDecimate; +import io.github.dsheirer.dsp.filter.design.FilterDesignException; +import io.github.dsheirer.dsp.filter.fir.FIRFilterSpecification; +import io.github.dsheirer.dsp.filter.fir.remez.RemezFIRFilterDesigner; import org.jtransforms.fft.FloatFFT_1D; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -52,7 +51,7 @@ public class FilterFactory public static float[] getSinc(int sampleRate, long frequency, int length, - WindowType window) + Window.WindowType window) { //Ensure we have an odd length assert (length % 2 == 0); @@ -215,7 +214,7 @@ public class FilterFactory public static float[] getLowPass(int sampleRate, long cutoff, int filterLength, - WindowType windowType) + Window.WindowType windowType) { if(filterLength % 2 == 0) //even length { @@ -251,7 +250,7 @@ public class FilterFactory int passFrequency, int stopFrequency, int attenuation, - WindowType windowType, + Window.WindowType windowType, boolean forceOddLength) { if(stopFrequency < passFrequency || stopFrequency > (sampleRate / 2)) @@ -293,7 +292,7 @@ public class FilterFactory public static float[] getHighPass(int sampleRate, long cutoff, int filterLength, - WindowType windowType) + Window.WindowType windowType) { //Convert the high frequency cutoff to its low frequency cutoff //equivalent, so that when we generate the low pass filter, prior to @@ -310,7 +309,7 @@ public class FilterFactory long stopFrequency, long passFrequency, int attenuation, - WindowType windowType, + Window.WindowType windowType, boolean forceOddLength) { /* reverse the stop and pass frequency to get the low pass variant */ @@ -385,7 +384,7 @@ public class FilterFactory public static ComplexPrimeCICDecimate getDecimationFilter(int sampleRate, int decimatedRate, int order, int passFrequency, int attenuation, - WindowType windowType) + Window.WindowType windowType) { int decimationRate = (int) (sampleRate / decimatedRate); @@ -579,7 +578,7 @@ public class FilterFactory public static float[] getCICCleanupFilter(int outputSampleRate, int passFrequency, int attenuation, - WindowType window) + Window.WindowType window) { int taps = getTapCount(outputSampleRate, passFrequency, passFrequency + 1500, attenuation); diff --git a/src/dsp/filter/Filters.java b/src/main/java/io/github/dsheirer/dsp/filter/Filters.java similarity index 99% rename from src/dsp/filter/Filters.java rename to src/main/java/io/github/dsheirer/dsp/filter/Filters.java index 4a015bf9..1d036505 100644 --- a/src/dsp/filter/Filters.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/Filters.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If notf, see ******************************************************************************/ -package dsp.filter; +package io.github.dsheirer.dsp.filter; public enum Filters { diff --git a/src/dsp/filter/FloatFIRFilter.java b/src/main/java/io/github/dsheirer/dsp/filter/FloatFIRFilter.java similarity index 97% rename from src/dsp/filter/FloatFIRFilter.java rename to src/main/java/io/github/dsheirer/dsp/filter/FloatFIRFilter.java index 16c0a39c..c712d238 100644 --- a/src/dsp/filter/FloatFIRFilter.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/FloatFIRFilter.java @@ -15,13 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.filter; +package io.github.dsheirer.dsp.filter; + +import io.github.dsheirer.sample.real.RealSampleListener; +import org.apache.commons.lang3.Validate; import java.util.ArrayList; -import org.apache.commons.lang3.Validate; -import sample.real.RealSampleListener; - public class FloatFIRFilter implements RealSampleListener { private RealSampleListener mListener; @@ -85,7 +85,7 @@ public class FloatFIRFilter implements RealSampleListener mBufferPointer = 0; } - //Convolution - multiply filter coefficients by the circular buffer + //Convolution - multiply filter coefficients by the circular buffer //samples to calculate a new filtered value float accumulator = 0.0f; diff --git a/src/dsp/filter/FloatHalfBandFilter.java b/src/main/java/io/github/dsheirer/dsp/filter/FloatHalfBandFilter.java similarity index 97% rename from src/dsp/filter/FloatHalfBandFilter.java rename to src/main/java/io/github/dsheirer/dsp/filter/FloatHalfBandFilter.java index 1d65deec..4722d9f2 100644 --- a/src/dsp/filter/FloatHalfBandFilter.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/FloatHalfBandFilter.java @@ -15,13 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.filter; +package io.github.dsheirer.dsp.filter; + +import io.github.dsheirer.sample.real.RealSampleListener; +import org.apache.commons.lang3.Validate; import java.util.ArrayList; -import org.apache.commons.lang3.Validate; -import sample.real.RealSampleListener; - public class FloatHalfBandFilter implements RealSampleListener { private RealSampleListener mListener; @@ -40,7 +40,7 @@ public class FloatHalfBandFilter implements RealSampleListener * Half-Band filter with decimation by 2 against real valued floats. * * Takes advantage of the symmetrical nature of FIR filter coefficients by - * adding oldest and newest sample first, then multiplying once by the + * adding oldest and newest sample first, then multiplying once by the * corresponding coefficient * * Also, takes advantage of the 0-valued FIR half-band coefficents inherent @@ -96,7 +96,7 @@ public class FloatHalfBandFilter implements RealSampleListener //Calculate a filtered sample when the flag is true if( mDispatchFlag ) { - //Convolution - multiply filter coefficients by the circular buffer + //Convolution - multiply filter coefficients by the circular buffer //samples to calculate a new filtered value float accumulator = 0; @@ -123,13 +123,13 @@ public class FloatHalfBandFilter implements RealSampleListener } /** - * Creates an n X (n + 1 / 2) index map enabling quick access to the - * circular buffer samples. + * Creates an n X (n + 1 / 2) index map enabling quick access to the + * circular buffer samples. * - * As the buffer shifts right with each subsequent sample, we have to move + * As the buffer shifts right with each subsequent sample, we have to move * the index pointers with it, for efficient access of the samples. * - * The first array index value in the index map corresponds to the current + * The first array index value in the index map corresponds to the current * buffer pointer location. * * The second array index value points to the samples that should be diff --git a/src/dsp/filter/FloatHalfBandNoDecimateFilter.java b/src/main/java/io/github/dsheirer/dsp/filter/FloatHalfBandNoDecimateFilter.java similarity index 97% rename from src/dsp/filter/FloatHalfBandNoDecimateFilter.java rename to src/main/java/io/github/dsheirer/dsp/filter/FloatHalfBandNoDecimateFilter.java index f2561bce..87a5f4cd 100644 --- a/src/dsp/filter/FloatHalfBandNoDecimateFilter.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/FloatHalfBandNoDecimateFilter.java @@ -15,13 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.filter; +package io.github.dsheirer.dsp.filter; + +import io.github.dsheirer.sample.real.RealSampleListener; +import org.apache.commons.lang3.Validate; import java.util.ArrayList; -import org.apache.commons.lang3.Validate; -import sample.real.RealSampleListener; - public class FloatHalfBandNoDecimateFilter implements RealSampleListener { private RealSampleListener mListener; @@ -38,7 +38,7 @@ public class FloatHalfBandNoDecimateFilter implements RealSampleListener * Half-Band filter with decimation by a real valued float. * * Takes advantage of the symmetrical nature of FIR filter coefficients by - * adding oldest and newest sample first, then multiplying once by the + * adding oldest and newest sample first, then multiplying once by the * corresponding coefficient * * Also, takes advantage of the 0-valued FIR half-band coefficents inherent @@ -87,7 +87,7 @@ public class FloatHalfBandNoDecimateFilter implements RealSampleListener mBufferPointer = 0; } - //Convolution - multiply filter coefficients by the circular buffer + //Convolution - multiply filter coefficients by the circular buffer //samples to calculate a new filtered value float accumulator = 0; @@ -113,13 +113,13 @@ public class FloatHalfBandNoDecimateFilter implements RealSampleListener } /** - * Creates an n X (n + 1 / 2) index map enabling quick access to the - * circular buffer samples. + * Creates an n X (n + 1 / 2) index map enabling quick access to the + * circular buffer samples. * - * As the buffer shifts right with each subsequent sample, we have to move + * As the buffer shifts right with each subsequent sample, we have to move * the index pointers with it, for efficient access of the samples. * - * The first array index value in the index map corresponds to the current + * The first array index value in the index map corresponds to the current * buffer pointer location. * * The second array index value points to the samples that should be diff --git a/src/dsp/filter/GoertzelFilter.java b/src/main/java/io/github/dsheirer/dsp/filter/GoertzelFilter.java similarity index 97% rename from src/dsp/filter/GoertzelFilter.java rename to src/main/java/io/github/dsheirer/dsp/filter/GoertzelFilter.java index a421f912..6bbb0997 100644 --- a/src/dsp/filter/GoertzelFilter.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/GoertzelFilter.java @@ -15,9 +15,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.filter; +package io.github.dsheirer.dsp.filter; -import dsp.filter.Window.WindowType; +import io.github.dsheirer.dsp.filter.Window.WindowType; /** @@ -82,7 +82,7 @@ public class GoertzelFilter * * @return - power measurement in dB - * @throws IllegalArgumentException if the sample array size is not equal + * @throws IllegalArgumentException if the sample array size is not equal * to the defined block size */ public int getPower( float[] samples ) throws IllegalArgumentException diff --git a/src/dsp/filter/IIRBiQuadraticFilter.java b/src/main/java/io/github/dsheirer/dsp/filter/IIRBiQuadraticFilter.java similarity index 99% rename from src/dsp/filter/IIRBiQuadraticFilter.java rename to src/main/java/io/github/dsheirer/dsp/filter/IIRBiQuadraticFilter.java index 67833080..6ab72dfc 100644 --- a/src/dsp/filter/IIRBiQuadraticFilter.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/IIRBiQuadraticFilter.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.filter; +package io.github.dsheirer.dsp.filter; /*************************************************************************** * Copyright (C) 2011 by Paul Lutus * diff --git a/src/dsp/filter/LTRPulseShapingFilter.java b/src/main/java/io/github/dsheirer/dsp/filter/LTRPulseShapingFilter.java similarity index 96% rename from src/dsp/filter/LTRPulseShapingFilter.java rename to src/main/java/io/github/dsheirer/dsp/filter/LTRPulseShapingFilter.java index 43af44c9..059907fc 100644 --- a/src/dsp/filter/LTRPulseShapingFilter.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/LTRPulseShapingFilter.java @@ -1,9 +1,9 @@ -package dsp.filter; +package io.github.dsheirer.dsp.filter; + +import io.github.dsheirer.sample.Listener; import java.util.BitSet; -import sample.Listener; - public class LTRPulseShapingFilter implements Listener { private int[][] mIndexes = { { 0, 1, 2, 3, 4 }, diff --git a/src/dsp/filter/SquaringFilter.java b/src/main/java/io/github/dsheirer/dsp/filter/SquaringFilter.java similarity index 91% rename from src/dsp/filter/SquaringFilter.java rename to src/main/java/io/github/dsheirer/dsp/filter/SquaringFilter.java index 3857e8a0..25d9d620 100644 --- a/src/dsp/filter/SquaringFilter.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/SquaringFilter.java @@ -15,10 +15,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.filter; +package io.github.dsheirer.dsp.filter; -import sample.Listener; -import sample.real.RealSampleListener; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.RealSampleListener; public class SquaringFilter implements RealSampleListener { diff --git a/src/dsp/filter/Window.java b/src/main/java/io/github/dsheirer/dsp/filter/Window.java similarity index 99% rename from src/dsp/filter/Window.java rename to src/main/java/io/github/dsheirer/dsp/filter/Window.java index 72e846b4..5ca75acd 100644 --- a/src/dsp/filter/Window.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/Window.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.filter; +package io.github.dsheirer.dsp.filter; import java.util.Arrays; diff --git a/src/dsp/filter/cic/ComplexPrimeCICDecimate.java b/src/main/java/io/github/dsheirer/dsp/filter/cic/ComplexPrimeCICDecimate.java similarity index 94% rename from src/dsp/filter/cic/ComplexPrimeCICDecimate.java rename to src/main/java/io/github/dsheirer/dsp/filter/cic/ComplexPrimeCICDecimate.java index 95bf15ce..2ad5d95e 100644 --- a/src/dsp/filter/cic/ComplexPrimeCICDecimate.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/cic/ComplexPrimeCICDecimate.java @@ -16,19 +16,19 @@ * along with this program. If not, see * ******************************************************************************/ -package dsp.filter.cic; +package io.github.dsheirer.dsp.filter.cic; -import dsp.filter.FilterFactory; -import dsp.filter.Filters; -import dsp.filter.Window.WindowType; -import dsp.filter.fir.complex.ComplexFIRFilter_CB_CB; -import dsp.filter.halfband.complex.HalfBandFilter_CB_CB; +import io.github.dsheirer.dsp.filter.FilterFactory; +import io.github.dsheirer.dsp.filter.Filters; +import io.github.dsheirer.dsp.filter.Window; +import io.github.dsheirer.dsp.filter.fir.complex.ComplexFIRFilter_CB_CB; +import io.github.dsheirer.dsp.filter.halfband.complex.HalfBandFilter_CB_CB; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.ComplexBuffer; +import io.github.dsheirer.sample.complex.ComplexSampleListener; +import io.github.dsheirer.sample.complex.ComplexToComplexBufferAssembler; +import io.github.dsheirer.sample.decimator.ComplexDecimator; import org.apache.commons.lang3.Validate; -import sample.Listener; -import sample.complex.ComplexBuffer; -import sample.complex.ComplexSampleListener; -import sample.complex.ComplexToComplexBufferAssembler; -import sample.decimator.ComplexDecimator; import java.util.ArrayList; import java.util.List; @@ -67,7 +67,7 @@ public class ComplexPrimeCICDecimate implements Listener * @param order - filter order */ public ComplexPrimeCICDecimate(int decimation, int order, - int passFrequency, int attenuation, WindowType windowType) + int passFrequency, int attenuation, Window.WindowType windowType) { Validate.isTrue(decimation <= 700); @@ -360,7 +360,7 @@ public class ComplexPrimeCICDecimate implements Listener Filters.FIR_HALF_BAND_31T_ONE_EIGHTH_FCO.getCoefficients(), 0.4f, false); public Output(int outputSampleRate, int passFrequency, int attenuation, - WindowType windowType) + Window.WindowType windowType) { mCleanupFilter = new ComplexFIRFilter_CB_CB(FilterFactory .getCICCleanupFilter(outputSampleRate, diff --git a/src/dsp/filter/cic/RealPrimeCICDecimate.java b/src/main/java/io/github/dsheirer/dsp/filter/cic/RealPrimeCICDecimate.java similarity index 93% rename from src/dsp/filter/cic/RealPrimeCICDecimate.java rename to src/main/java/io/github/dsheirer/dsp/filter/cic/RealPrimeCICDecimate.java index 36964a05..2b1b2b82 100644 --- a/src/dsp/filter/cic/RealPrimeCICDecimate.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/cic/RealPrimeCICDecimate.java @@ -15,25 +15,24 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.filter.cic; - -import java.util.ArrayList; -import java.util.List; +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; +import io.github.dsheirer.sample.real.RealBuffer; +import io.github.dsheirer.sample.real.RealSampleListener; +import io.github.dsheirer.sample.real.RealToRealBufferAssembler; import org.apache.commons.lang3.Validate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import dsp.filter.FilterFactory; -import dsp.filter.Filters; -import dsp.filter.Window.WindowType; -import dsp.filter.fir.real.RealFIRFilter_RB_RB; -import dsp.filter.halfband.real.HalfBandFilter_RB_RB; -import sample.Listener; -import sample.decimator.RealDecimator; -import sample.real.RealBuffer; -import sample.real.RealSampleListener; -import sample.real.RealToRealBufferAssembler; +import java.util.ArrayList; +import java.util.List; public class RealPrimeCICDecimate { @@ -61,8 +60,8 @@ public class RealPrimeCICDecimate * Non-Recursive Prime-Factor CIC Filter with float sample array inputs and * decimated float sample output. * - * Implements the CIC filter described in Understanding Digital Signal - * Processing, 3e, Lyons, on page 769. This filter is comprised of multiple + * Implements the CIC filter described in Understanding Digital Signal + * Processing, 3e, Lyons, on page 769. This filter is comprised of multiple * decimating stages each with a prime factor decimation rate. Multiple * stages are cascaded to achieve the overall decimation rate. * @@ -350,8 +349,8 @@ public class RealPrimeCICDecimate } /** - * Output adapter - applies gain correction, applies cleanup filter, casts - * double-valued samples into float-valued complex sample and sends the + * Output adapter - applies gain correction, applies cleanup filter, casts + * double-valued samples into float-valued complex sample and sends the * result to the registered listener. */ public class Output implements RealSampleListener @@ -360,7 +359,7 @@ public class RealPrimeCICDecimate private RealToRealBufferAssembler mAssembler; private RealFIRFilter_RB_RB mCleanupFilter; - private HalfBandFilter_RB_RB mHalfBandFilter = new HalfBandFilter_RB_RB( + private HalfBandFilter_RB_RB mHalfBandFilter = new HalfBandFilter_RB_RB( Filters.FIR_HALF_BAND_31T_ONE_EIGHTH_FCO.getCoefficients(), 0.4f, false ); public Output( int outputSampleRate, int passFrequency, int attenuation, diff --git a/src/dsp/filter/dc/DCRemovalFilter.java b/src/main/java/io/github/dsheirer/dsp/filter/dc/DCRemovalFilter.java similarity index 96% rename from src/dsp/filter/dc/DCRemovalFilter.java rename to src/main/java/io/github/dsheirer/dsp/filter/dc/DCRemovalFilter.java index 292f2925..d265b8e6 100644 --- a/src/dsp/filter/dc/DCRemovalFilter.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/dc/DCRemovalFilter.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.filter.dc; +package io.github.dsheirer.dsp.filter.dc; public class DCRemovalFilter { diff --git a/src/dsp/filter/dc/DCRemovalFilterLyons.java b/src/main/java/io/github/dsheirer/dsp/filter/dc/DCRemovalFilterLyons.java similarity index 94% rename from src/dsp/filter/dc/DCRemovalFilterLyons.java rename to src/main/java/io/github/dsheirer/dsp/filter/dc/DCRemovalFilterLyons.java index d24aa5a9..dac1a25a 100644 --- a/src/dsp/filter/dc/DCRemovalFilterLyons.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/dc/DCRemovalFilterLyons.java @@ -15,9 +15,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.filter.dc; +package io.github.dsheirer.dsp.filter.dc; -import sample.real.RealSampleListener; +import io.github.dsheirer.sample.real.RealSampleListener; /** * Implements the real-time general DC removal algorithm described on page diff --git a/src/dsp/filter/dc/DCRemovalFilter_CB.java b/src/main/java/io/github/dsheirer/dsp/filter/dc/DCRemovalFilter_CB.java similarity index 92% rename from src/dsp/filter/dc/DCRemovalFilter_CB.java rename to src/main/java/io/github/dsheirer/dsp/filter/dc/DCRemovalFilter_CB.java index 201634fe..28deb686 100644 --- a/src/dsp/filter/dc/DCRemovalFilter_CB.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/dc/DCRemovalFilter_CB.java @@ -15,10 +15,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.filter.dc; +package io.github.dsheirer.dsp.filter.dc; -import sample.Listener; -import sample.complex.ComplexBuffer; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.ComplexBuffer; public class DCRemovalFilter_CB implements Listener { diff --git a/src/dsp/filter/dc/DCRemovalFilter_RB.java b/src/main/java/io/github/dsheirer/dsp/filter/dc/DCRemovalFilter_RB.java similarity index 87% rename from src/dsp/filter/dc/DCRemovalFilter_RB.java rename to src/main/java/io/github/dsheirer/dsp/filter/dc/DCRemovalFilter_RB.java index 07ef4582..74892dae 100644 --- a/src/dsp/filter/dc/DCRemovalFilter_RB.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/dc/DCRemovalFilter_RB.java @@ -1,7 +1,7 @@ -package dsp.filter.dc; +package io.github.dsheirer.dsp.filter.dc; -import sample.Listener; -import sample.real.RealBuffer; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.RealBuffer; public class DCRemovalFilter_RB extends DCRemovalFilter implements Listener diff --git a/src/dsp/filter/dc/DCRemovalFilter_R_R.java b/src/main/java/io/github/dsheirer/dsp/filter/dc/DCRemovalFilter_R_R.java similarity index 93% rename from src/dsp/filter/dc/DCRemovalFilter_R_R.java rename to src/main/java/io/github/dsheirer/dsp/filter/dc/DCRemovalFilter_R_R.java index c2c8f1be..ee5c8c53 100644 --- a/src/dsp/filter/dc/DCRemovalFilter_R_R.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/dc/DCRemovalFilter_R_R.java @@ -15,9 +15,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.filter.dc; +package io.github.dsheirer.dsp.filter.dc; -import sample.real.RealSampleListener; +import io.github.dsheirer.sample.real.RealSampleListener; public class DCRemovalFilter_R_R extends DCRemovalFilter implements RealSampleListener { diff --git a/src/dsp/filter/dc/DCRemovalFilter_RealBuffer.java b/src/main/java/io/github/dsheirer/dsp/filter/dc/DCRemovalFilter_RealBuffer.java similarity index 88% rename from src/dsp/filter/dc/DCRemovalFilter_RealBuffer.java rename to src/main/java/io/github/dsheirer/dsp/filter/dc/DCRemovalFilter_RealBuffer.java index 308b4ed7..f401aaf4 100644 --- a/src/dsp/filter/dc/DCRemovalFilter_RealBuffer.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/dc/DCRemovalFilter_RealBuffer.java @@ -1,7 +1,7 @@ -package dsp.filter.dc; +package io.github.dsheirer.dsp.filter.dc; -import sample.Listener; -import sample.real.RealBuffer; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.RealBuffer; public class DCRemovalFilter_RealBuffer implements Listener { diff --git a/src/dsp/filter/dc/IIRSinglePoleDCRemovalFilter.java b/src/main/java/io/github/dsheirer/dsp/filter/dc/IIRSinglePoleDCRemovalFilter.java similarity index 90% rename from src/dsp/filter/dc/IIRSinglePoleDCRemovalFilter.java rename to src/main/java/io/github/dsheirer/dsp/filter/dc/IIRSinglePoleDCRemovalFilter.java index 8edcffc2..83a59eae 100644 --- a/src/dsp/filter/dc/IIRSinglePoleDCRemovalFilter.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/dc/IIRSinglePoleDCRemovalFilter.java @@ -1,6 +1,6 @@ -package dsp.filter.dc; +package io.github.dsheirer.dsp.filter.dc; -import sample.real.RealSampleListener; +import io.github.dsheirer.sample.real.RealSampleListener; public class IIRSinglePoleDCRemovalFilter implements RealSampleListener { diff --git a/src/dsp/filter/dc/IIRSinglePoleDCRemovalFilter_RB.java b/src/main/java/io/github/dsheirer/dsp/filter/dc/IIRSinglePoleDCRemovalFilter_RB.java similarity index 91% rename from src/dsp/filter/dc/IIRSinglePoleDCRemovalFilter_RB.java rename to src/main/java/io/github/dsheirer/dsp/filter/dc/IIRSinglePoleDCRemovalFilter_RB.java index b52f6912..974374c0 100644 --- a/src/dsp/filter/dc/IIRSinglePoleDCRemovalFilter_RB.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/dc/IIRSinglePoleDCRemovalFilter_RB.java @@ -1,7 +1,7 @@ -package dsp.filter.dc; +package io.github.dsheirer.dsp.filter.dc; -import sample.Listener; -import sample.real.RealBuffer; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.RealBuffer; public class IIRSinglePoleDCRemovalFilter_RB implements Listener { diff --git a/src/dsp/filter/design/FilterDesignException.java b/src/main/java/io/github/dsheirer/dsp/filter/design/FilterDesignException.java similarity index 87% rename from src/dsp/filter/design/FilterDesignException.java rename to src/main/java/io/github/dsheirer/dsp/filter/design/FilterDesignException.java index ac2c5a75..f14eb8bd 100644 --- a/src/dsp/filter/design/FilterDesignException.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/design/FilterDesignException.java @@ -1,4 +1,4 @@ -package dsp.filter.design; +package io.github.dsheirer.dsp.filter.design; public class FilterDesignException extends Exception { diff --git a/src/dsp/filter/design/FilterView.css b/src/main/java/io/github/dsheirer/dsp/filter/design/FilterView.css similarity index 100% rename from src/dsp/filter/design/FilterView.css rename to src/main/java/io/github/dsheirer/dsp/filter/design/FilterView.css diff --git a/src/dsp/filter/design/FilterView.java b/src/main/java/io/github/dsheirer/dsp/filter/design/FilterView.java similarity index 95% rename from src/dsp/filter/design/FilterView.java rename to src/main/java/io/github/dsheirer/dsp/filter/design/FilterView.java index 12191462..edaa4289 100644 --- a/src/dsp/filter/design/FilterView.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/design/FilterView.java @@ -1,14 +1,6 @@ -package dsp.filter.design; +package io.github.dsheirer.dsp.filter.design; -import org.jtransforms.fft.FloatFFT_1D; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import dsp.filter.FilterFactory; -import dsp.filter.Window.WindowType; -import dsp.filter.fir.FIRFilterSpecification; -import dsp.filter.fir.remez.RemezFIRFilterDesigner; -import gui.control.CurveFittedAreaChart; +import io.github.dsheirer.gui.control.CurveFittedAreaChart; import javafx.collections.ObservableList; import javafx.scene.chart.NumberAxis; import javafx.scene.chart.XYChart; @@ -16,6 +8,9 @@ import javafx.scene.chart.XYChart.Series; import javafx.scene.layout.BorderPane; import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; +import org.jtransforms.fft.FloatFFT_1D; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class FilterView extends BorderPane { diff --git a/src/dsp/filter/design/FilterViewer.java b/src/main/java/io/github/dsheirer/dsp/filter/design/FilterViewer.java similarity index 93% rename from src/dsp/filter/design/FilterViewer.java rename to src/main/java/io/github/dsheirer/dsp/filter/design/FilterViewer.java index 85c710ca..e2e7d9ca 100644 --- a/src/dsp/filter/design/FilterViewer.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/design/FilterViewer.java @@ -1,7 +1,7 @@ -package dsp.filter.design; +package io.github.dsheirer.dsp.filter.design; -import dsp.filter.fir.FIRFilterSpecification; -import dsp.filter.fir.remez.RemezFIRFilterDesigner; +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; diff --git a/src/dsp/filter/equalizer/CMAEqualizer.java b/src/main/java/io/github/dsheirer/dsp/filter/equalizer/CMAEqualizer.java similarity index 93% rename from src/dsp/filter/equalizer/CMAEqualizer.java rename to src/main/java/io/github/dsheirer/dsp/filter/equalizer/CMAEqualizer.java index bbf79332..2621da86 100644 --- a/src/dsp/filter/equalizer/CMAEqualizer.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/equalizer/CMAEqualizer.java @@ -1,11 +1,10 @@ -package dsp.filter.equalizer; +package io.github.dsheirer.dsp.filter.equalizer; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.Complex; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; -import sample.complex.Complex; - public class CMAEqualizer implements Listener { private final static Logger mLog = LoggerFactory.getLogger( CMAEqualizer.class ); @@ -42,8 +41,8 @@ public class CMAEqualizer implements Listener private void updateTaps( Complex sample ) { - /* Calculate the error. The ideal sample magnitude is unity (1.0). - * When the sample is not at unity, the error vector points in the + /* Calculate the error. The ideal sample magnitude is unity (1.0). + * When the sample is not at unity, the error vector points in the * opposite direction with a magnitude equal to 1 - sample magnitude.*/ mError = Complex.multiply( sample, sample.norm() - mModulus ); diff --git a/src/dsp/filter/fir/FIRFilter.java b/src/main/java/io/github/dsheirer/dsp/filter/fir/FIRFilter.java similarity index 61% rename from src/dsp/filter/fir/FIRFilter.java rename to src/main/java/io/github/dsheirer/dsp/filter/fir/FIRFilter.java index f0f19d06..f88b560f 100644 --- a/src/dsp/filter/fir/FIRFilter.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/fir/FIRFilter.java @@ -1,4 +1,4 @@ -package dsp.filter.fir; +package io.github.dsheirer.dsp.filter.fir; public abstract class FIRFilter { diff --git a/src/dsp/filter/fir/FIRFilterSpecification.java b/src/main/java/io/github/dsheirer/dsp/filter/fir/FIRFilterSpecification.java similarity index 99% rename from src/dsp/filter/fir/FIRFilterSpecification.java rename to src/main/java/io/github/dsheirer/dsp/filter/fir/FIRFilterSpecification.java index b03e82ec..661038df 100644 --- a/src/dsp/filter/fir/FIRFilterSpecification.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/fir/FIRFilterSpecification.java @@ -1,12 +1,12 @@ -package dsp.filter.fir; +package io.github.dsheirer.dsp.filter.fir; + +import io.github.dsheirer.dsp.filter.fir.remez.FIRLinearPhaseFilterType; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Collection; import java.util.List; -import dsp.filter.fir.remez.FIRLinearPhaseFilterType; - public class FIRFilterSpecification { private static final DecimalFormat DECIMAL_FORMATTER = new DecimalFormat( "0.00000" ); diff --git a/src/dsp/filter/fir/complex/ComplexFIRFilter.java b/src/main/java/io/github/dsheirer/dsp/filter/fir/complex/ComplexFIRFilter.java similarity index 82% rename from src/dsp/filter/fir/complex/ComplexFIRFilter.java rename to src/main/java/io/github/dsheirer/dsp/filter/fir/complex/ComplexFIRFilter.java index 744c27b9..8190b9a1 100644 --- a/src/dsp/filter/fir/complex/ComplexFIRFilter.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/fir/complex/ComplexFIRFilter.java @@ -1,8 +1,8 @@ -package dsp.filter.fir.complex; +package io.github.dsheirer.dsp.filter.fir.complex; -import sample.complex.Complex; -import dsp.filter.fir.FIRFilter; -import dsp.filter.fir.real.RealFIRFilter; +import io.github.dsheirer.dsp.filter.fir.FIRFilter; +import io.github.dsheirer.dsp.filter.fir.real.RealFIRFilter; +import io.github.dsheirer.sample.complex.Complex; public class ComplexFIRFilter extends FIRFilter { @@ -10,7 +10,7 @@ public class ComplexFIRFilter extends FIRFilter private RealFIRFilter mQFilter; /** - * Complex FIR Filter for processing complex sample pairs. Wraps two real + * Complex FIR Filter for processing complex sample pairs. Wraps two real * FIR filters for processing each of the inphase and quadrature samples. * * @param coefficients - filter taps diff --git a/src/dsp/filter/fir/complex/ComplexFIRFilter_CB_CB.java b/src/main/java/io/github/dsheirer/dsp/filter/fir/complex/ComplexFIRFilter_CB_CB.java similarity index 87% rename from src/dsp/filter/fir/complex/ComplexFIRFilter_CB_CB.java rename to src/main/java/io/github/dsheirer/dsp/filter/fir/complex/ComplexFIRFilter_CB_CB.java index 259d631a..33cd4862 100644 --- a/src/dsp/filter/fir/complex/ComplexFIRFilter_CB_CB.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/fir/complex/ComplexFIRFilter_CB_CB.java @@ -1,7 +1,7 @@ -package dsp.filter.fir.complex; +package io.github.dsheirer.dsp.filter.fir.complex; -import sample.Listener; -import sample.complex.ComplexBuffer; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.ComplexBuffer; public class ComplexFIRFilter_CB_CB extends ComplexFIRFilter implements Listener diff --git a/src/dsp/filter/fir/real/RealFIRFilter.java b/src/main/java/io/github/dsheirer/dsp/filter/fir/real/RealFIRFilter.java similarity index 95% rename from src/dsp/filter/fir/real/RealFIRFilter.java rename to src/main/java/io/github/dsheirer/dsp/filter/fir/real/RealFIRFilter.java index fa3e28e7..d582dfa1 100644 --- a/src/dsp/filter/fir/real/RealFIRFilter.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/fir/real/RealFIRFilter.java @@ -15,9 +15,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.filter.fir.real; +package io.github.dsheirer.dsp.filter.fir.real; -import dsp.filter.fir.FIRFilter; +import io.github.dsheirer.dsp.filter.fir.FIRFilter; public class RealFIRFilter extends FIRFilter { @@ -85,7 +85,7 @@ public class RealFIRFilter extends FIRFilter } /** - * Generates a circular buffer index map to support lookup of the translated + * Generates a circular buffer index map to support lookup of the translated * index based on the current buffer pointer and the desired sample index. */ private void generateIndexMap( int size ) diff --git a/src/dsp/filter/fir/real/RealFIRFilter_RB_RB.java b/src/main/java/io/github/dsheirer/dsp/filter/fir/real/RealFIRFilter_RB_RB.java similarity index 87% rename from src/dsp/filter/fir/real/RealFIRFilter_RB_RB.java rename to src/main/java/io/github/dsheirer/dsp/filter/fir/real/RealFIRFilter_RB_RB.java index 7f9fc957..22197bbe 100644 --- a/src/dsp/filter/fir/real/RealFIRFilter_RB_RB.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/fir/real/RealFIRFilter_RB_RB.java @@ -1,7 +1,7 @@ -package dsp.filter.fir.real; +package io.github.dsheirer.dsp.filter.fir.real; -import sample.Listener; -import sample.real.RealBuffer; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.RealBuffer; public class RealFIRFilter_RB_RB extends RealFIRFilter implements Listener @@ -9,7 +9,7 @@ public class RealFIRFilter_RB_RB extends RealFIRFilter private Listener mListener; /** - * Real Buffer Float FIR filter with streaming float buffer provider and + * Real Buffer Float FIR filter with streaming float buffer provider and * listener interfaces. * * @param coefficients diff --git a/src/dsp/filter/fir/real/RealFIRFilter_R_R.java b/src/main/java/io/github/dsheirer/dsp/filter/fir/real/RealFIRFilter_R_R.java similarity index 89% rename from src/dsp/filter/fir/real/RealFIRFilter_R_R.java rename to src/main/java/io/github/dsheirer/dsp/filter/fir/real/RealFIRFilter_R_R.java index b00bf317..f96feda4 100644 --- a/src/dsp/filter/fir/real/RealFIRFilter_R_R.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/fir/real/RealFIRFilter_R_R.java @@ -1,6 +1,6 @@ -package dsp.filter.fir.real; +package io.github.dsheirer.dsp.filter.fir.real; -import sample.real.RealSampleListener; +import io.github.dsheirer.sample.real.RealSampleListener; public class RealFIRFilter_R_R extends RealFIRFilter implements RealSampleListener { diff --git a/src/dsp/filter/fir/remez/FIRLinearPhaseFilterType.java b/src/main/java/io/github/dsheirer/dsp/filter/fir/remez/FIRLinearPhaseFilterType.java similarity index 96% rename from src/dsp/filter/fir/remez/FIRLinearPhaseFilterType.java rename to src/main/java/io/github/dsheirer/dsp/filter/fir/remez/FIRLinearPhaseFilterType.java index aef00ec7..4b6ad8e5 100644 --- a/src/dsp/filter/fir/remez/FIRLinearPhaseFilterType.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/fir/remez/FIRLinearPhaseFilterType.java @@ -1,4 +1,4 @@ -package dsp.filter.fir.remez; +package io.github.dsheirer.dsp.filter.fir.remez; public enum FIRLinearPhaseFilterType { diff --git a/src/dsp/filter/fir/remez/Grid.java b/src/main/java/io/github/dsheirer/dsp/filter/fir/remez/Grid.java similarity index 93% rename from src/dsp/filter/fir/remez/Grid.java rename to src/main/java/io/github/dsheirer/dsp/filter/fir/remez/Grid.java index bca44b40..302202d1 100644 --- a/src/dsp/filter/fir/remez/Grid.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/fir/remez/Grid.java @@ -1,7 +1,6 @@ -package dsp.filter.fir.remez; +package io.github.dsheirer.dsp.filter.fir.remez; -import dsp.filter.fir.FIRFilterSpecification; -import dsp.filter.fir.FIRFilterSpecification.FrequencyBand; +import io.github.dsheirer.dsp.filter.fir.FIRFilterSpecification; public class Grid { @@ -45,7 +44,7 @@ public class Grid for( int x = 0; x < specification.getFrequencyBands().size(); x++ ) { - FrequencyBand band = specification.getFrequencyBands().get( x ); + FIRFilterSpecification.FrequencyBand band = specification.getFrequencyBands().get( x ); double lowFrequency = ( x == 0 ? grid0 : band.getStart() ); diff --git a/src/dsp/filter/fir/remez/RemezFIRFilterDesigner.java b/src/main/java/io/github/dsheirer/dsp/filter/fir/remez/RemezFIRFilterDesigner.java similarity index 98% rename from src/dsp/filter/fir/remez/RemezFIRFilterDesigner.java rename to src/main/java/io/github/dsheirer/dsp/filter/fir/remez/RemezFIRFilterDesigner.java index e5ca196b..9a6dca91 100644 --- a/src/dsp/filter/fir/remez/RemezFIRFilterDesigner.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/fir/remez/RemezFIRFilterDesigner.java @@ -1,16 +1,15 @@ -package dsp.filter.fir.remez; +package io.github.dsheirer.dsp.filter.fir.remez; + +import io.github.dsheirer.dsp.filter.design.FilterDesignException; +import io.github.dsheirer.dsp.filter.fir.FIRFilterSpecification; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import dsp.filter.design.FilterDesignException; -import dsp.filter.fir.FIRFilterSpecification; - public class RemezFIRFilterDesigner { private final static Logger mLog = LoggerFactory.getLogger( RemezFIRFilterDesigner.class ); @@ -37,13 +36,13 @@ public class RemezFIRFilterDesigner /** * Linear FIR filter designer using the Parks-McClelland Remez exchange algorithm. * - * Construct a filter specification using the builder methods in the FIRFilterSpecification + * Construct a filter specification using the builder methods in the FIRFilterSpecification * class and construct an instance of this class with the specification. Check the isValid() * method after construction to see if the filter design was successful. If successful, use the - * getFrequencyResponse() and getImpulseResponse() methods to access the filter taps as the + * getFrequencyResponse() and getImpulseResponse() methods to access the filter taps as the * specified length. * - * If the filter cannot be designed from the specification the isValid() method will return + * If the filter cannot be designed from the specification the isValid() method will return * false and any attempts to access the getFrequencyResponse() or getImpulseResponse() methods * will throw a FilterDesignException. * @@ -82,7 +81,7 @@ public class RemezFIRFilterDesigner catch( FilterDesignException fde ) { mLog.error( "Filter design error - couldn't find extremal indices at count [" + - iterationCount + "] try changing filter order up/down from [" + + iterationCount + "] try changing filter order up/down from [" + mSpecification.getOrder() + "]" ); mConverged = false; @@ -608,7 +607,7 @@ public class RemezFIRFilterDesigner /** * Resamples the designed filter at half of the filter length at evenly spaced intervals of the - * frequency spectrum from 0 to PI radians. + * frequency spectrum from 0 to PI radians. * * @return frequency response of the filter sampled the desired filter length and order */ diff --git a/src/dsp/filter/halfband/complex/HalfBandFilter_CB_CB.java b/src/main/java/io/github/dsheirer/dsp/filter/halfband/complex/HalfBandFilter_CB_CB.java similarity index 89% rename from src/dsp/filter/halfband/complex/HalfBandFilter_CB_CB.java rename to src/main/java/io/github/dsheirer/dsp/filter/halfband/complex/HalfBandFilter_CB_CB.java index a2707208..337077be 100644 --- a/src/dsp/filter/halfband/complex/HalfBandFilter_CB_CB.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/halfband/complex/HalfBandFilter_CB_CB.java @@ -1,8 +1,8 @@ -package dsp.filter.halfband.complex; +package io.github.dsheirer.dsp.filter.halfband.complex; -import sample.Listener; -import sample.complex.ComplexBuffer; -import dsp.filter.halfband.real.HalfBandFilter; +import io.github.dsheirer.dsp.filter.halfband.real.HalfBandFilter; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.ComplexBuffer; public class HalfBandFilter_CB_CB implements Listener { @@ -55,7 +55,7 @@ public class HalfBandFilter_CB_CB implements Listener } else { - /* If inbound buffer size is odd-length, then we have to + /* If inbound buffer size is odd-length, then we have to * adjust when the first operation is non-decimation, since * that will produce an outbound buffer 1 sample larger */ decimated = new float[ half + 1 ]; diff --git a/src/dsp/filter/halfband/real/HalfBandFilter.java b/src/main/java/io/github/dsheirer/dsp/filter/halfband/real/HalfBandFilter.java similarity index 97% rename from src/dsp/filter/halfband/real/HalfBandFilter.java rename to src/main/java/io/github/dsheirer/dsp/filter/halfband/real/HalfBandFilter.java index 831c8b5c..678cb8e5 100644 --- a/src/dsp/filter/halfband/real/HalfBandFilter.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/halfband/real/HalfBandFilter.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.filter.halfband.real; +package io.github.dsheirer.dsp.filter.halfband.real; import org.apache.commons.lang3.Validate; @@ -97,13 +97,13 @@ public class HalfBandFilter } /** - * Creates an n X (n + 1 / 2) index map enabling quick access to the - * circular buffer samples. + * Creates an n X (n + 1 / 2) index map enabling quick access to the + * circular buffer samples. * - * As the buffer shifts right with each subsequent sample, we have to move + * As the buffer shifts right with each subsequent sample, we have to move * the index pointers with it, for efficient access of the samples. * - * The first array index value in the index map corresponds to the current + * The first array index value in the index map corresponds to the current * buffer pointer location. * * The second array index value points to the samples that should be diff --git a/src/dsp/filter/halfband/real/HalfBandFilter_RB_RB.java b/src/main/java/io/github/dsheirer/dsp/filter/halfband/real/HalfBandFilter_RB_RB.java similarity index 90% rename from src/dsp/filter/halfband/real/HalfBandFilter_RB_RB.java rename to src/main/java/io/github/dsheirer/dsp/filter/halfband/real/HalfBandFilter_RB_RB.java index fe673d48..914d9f2b 100644 --- a/src/dsp/filter/halfband/real/HalfBandFilter_RB_RB.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/halfband/real/HalfBandFilter_RB_RB.java @@ -1,7 +1,7 @@ -package dsp.filter.halfband.real; +package io.github.dsheirer.dsp.filter.halfband.real; -import sample.Listener; -import sample.real.RealBuffer; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.RealBuffer; public class HalfBandFilter_RB_RB extends HalfBandFilter implements Listener { @@ -10,16 +10,16 @@ public class HalfBandFilter_RB_RB extends HalfBandFilter implements Listener mListener; /** - * Halfband filter for real buffers with optional decimation by two. + * Halfband filter for real buffers with optional decimation by two. * - * If this filter is used in non-decimating mode, the filter will overwrite - * the inbound sample buffer with the filtered samples. This will cause + * If this filter is used in non-decimating mode, the filter will overwrite + * the inbound sample buffer with the filtered samples. This will cause * issues if the buffers are being used across several processes are sharing - * the buffer, since this filter will modify the contents of the object, so - * consider making a copy of the buffer prior to feeding the buffer to this + * the buffer, since this filter will modify the contents of the object, so + * consider making a copy of the buffer prior to feeding the buffer to this * filter. * - * If used in decimating mode, a new (half-length) buffer will be created + * If used in decimating mode, a new (half-length) buffer will be created * for the filtered samples. * * @param coefficients - filter kernel @@ -65,7 +65,7 @@ public class HalfBandFilter_RB_RB extends HalfBandFilter implements Listener ******************************************************************************/ -import java.util.Arrays; - +import io.github.dsheirer.dsp.filter.Filters; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.ComplexBuffer; +import io.github.dsheirer.sample.real.RealBuffer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; -import sample.complex.ComplexBuffer; -import sample.real.RealBuffer; -import dsp.filter.Filters; +import java.util.Arrays; public class HilbertTransform implements Listener { @@ -50,13 +49,13 @@ public class HilbertTransform implements Listener /** * Hilbert transform filter used for converting real-valued samples into * complex valued samples using frequency translation (FS/4) and a half-band - * filter. + * filter. * * This filter uses a circular sample buffer and a pre-calculated * index map to correctly map the filter coefficients to the circular delay * buffer contents as each new sample is added to the buffer and processed. * - * Half-band filter coefficients used in this filter must be of length N + * Half-band filter coefficients used in this filter must be of length N * where (N + 1) is a multiple of 4. This filter uses a pre-defined half * band filter with 47 coefficients. * @@ -94,7 +93,7 @@ public class HilbertTransform implements Listener } /** - * Applies Hilbert transform to the real sample buffer and returns a + * Applies Hilbert transform to the real sample buffer and returns a * complex sample buffer */ public ComplexBuffer filter( RealBuffer buffer ) @@ -103,7 +102,7 @@ public class HilbertTransform implements Listener } /** - * Filters the continuous real-sample stream by treating the stream as a + * Filters the continuous real-sample stream by treating the stream as a * set of interleaved values and applying two hilbert filters against each * interleaved set (I & Q). Frequency translation has already been * pre-applied to the hilbert filter coefficients. @@ -114,7 +113,7 @@ public class HilbertTransform implements Listener * Filtering of the quadrature component uses a folded FIR structure and * expects the hilbert coefficients to be symmetric with all negative valued * coefficients below the center coefficient and all positive-valued coefficients - * above the center coefficient. So, convolution only applies the filter + * above the center coefficient. So, convolution only applies the filter * coefficient against the difference of the two samples. * * ( coefficient * value1 ) + (-coefficient * value2 ) = coefficient * ( value1 - value2 ) @@ -177,14 +176,14 @@ public class HilbertTransform implements Listener } /** - * Creates an index map to support efficient lookup of sample indexes from + * Creates an index map to support efficient lookup of sample indexes from * the circular buffer. * * The first index of the map corresponds to the current buffer pointer * setting. * * The second index is structured in sample pairs to align with - * the hilbert filter coefficients. For example, the first iteration of + * the hilbert filter coefficients. For example, the first iteration of * the filter would use filter coefficient 0 and the index map values 0 and * 1 would be pointing to samples 46 and 0. * diff --git a/src/dsp/filter/hilbert/InterpolatingHilbertTransform.java b/src/main/java/io/github/dsheirer/dsp/filter/hilbert/InterpolatingHilbertTransform.java similarity index 97% rename from src/dsp/filter/hilbert/InterpolatingHilbertTransform.java rename to src/main/java/io/github/dsheirer/dsp/filter/hilbert/InterpolatingHilbertTransform.java index e54f3d07..75f7b9f2 100644 --- a/src/dsp/filter/hilbert/InterpolatingHilbertTransform.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/hilbert/InterpolatingHilbertTransform.java @@ -1,4 +1,4 @@ -package dsp.filter.hilbert; +package io.github.dsheirer.dsp.filter.hilbert; /******************************************************************************* * SDR Trunk @@ -42,14 +42,13 @@ package dsp.filter.hilbert; * THE SOFTWARE. ******************************************************************************/ -import java.util.Arrays; - +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.ComplexBuffer; +import io.github.dsheirer.sample.real.RealBuffer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; -import sample.complex.ComplexBuffer; -import sample.real.RealBuffer; +import java.util.Arrays; public class InterpolatingHilbertTransform implements Listener { @@ -87,13 +86,13 @@ public class InterpolatingHilbertTransform implements Listener /** * Hilbert transform filter used for converting real-valued samples into * complex valued samples using frequency translation (FS/4) and a half-band - * filter. + * filter. * * This filter uses a circular sample buffer and a pre-calculated * index map to correctly map the filter coefficients to the circular delay * buffer contents as each new sample is added to the buffer and processed. * - * Half-band filter coefficients used in this filter must be of length N + * Half-band filter coefficients used in this filter must be of length N * where (N + 1) is a multiple of 4. This filter uses a pre-defined half * band filter with 47 coefficients. * @@ -129,7 +128,7 @@ public class InterpolatingHilbertTransform implements Listener } /** - * Applies Hilbert transform to the real sample buffer and returns a + * Applies Hilbert transform to the real sample buffer and returns a * complex sample buffer */ public ComplexBuffer filter( RealBuffer buffer ) @@ -186,7 +185,7 @@ public class InterpolatingHilbertTransform implements Listener /** - * Creates an N x (N + 1 / 2) index map enabling quick access to the + * Creates an N x (N + 1 / 2) index map enabling quick access to the * circular buffer samples to support convolution. * * As the buffer pointer shifts right, as each sample is added, we use the @@ -195,7 +194,7 @@ public class InterpolatingHilbertTransform implements Listener * * We add an extra index to each index map with a value that points to the * current index of the middle sample in the buffer, so that we can retrieve - * that value as the half-group delayed sample that forms the inphase + * that value as the half-group delayed sample that forms the inphase * component. */ private void generateIndexMap( int size ) @@ -215,7 +214,7 @@ public class InterpolatingHilbertTransform implements Listener mIndexMap[ 0 ][ x ] = size - 1 - ( x * 2 ); } - //Place the group delayed in-phase sample tap point in last element of + //Place the group delayed in-phase sample tap point in last element of //the first row mIndexMap[ 0 ][ mGroupDelayedInphaseTapPointIndex ] = center; diff --git a/src/dsp/filter/iir/DeemphasisFilter.java b/src/main/java/io/github/dsheirer/dsp/filter/iir/DeemphasisFilter.java similarity index 91% rename from src/dsp/filter/iir/DeemphasisFilter.java rename to src/main/java/io/github/dsheirer/dsp/filter/iir/DeemphasisFilter.java index 9ba94b70..ea14ac02 100644 --- a/src/dsp/filter/iir/DeemphasisFilter.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/iir/DeemphasisFilter.java @@ -1,6 +1,6 @@ -package dsp.filter.iir; +package io.github.dsheirer.dsp.filter.iir; -import sample.real.RealBuffer; +import io.github.dsheirer.sample.real.RealBuffer; public class DeemphasisFilter { diff --git a/src/dsp/filter/interpolator/Interpolator.java b/src/main/java/io/github/dsheirer/dsp/filter/interpolator/Interpolator.java similarity index 99% rename from src/dsp/filter/interpolator/Interpolator.java rename to src/main/java/io/github/dsheirer/dsp/filter/interpolator/Interpolator.java index 3c296898..a0b1e8e4 100644 --- a/src/dsp/filter/interpolator/Interpolator.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/interpolator/Interpolator.java @@ -1,4 +1,4 @@ -package dsp.filter.interpolator; +package io.github.dsheirer.dsp.filter.interpolator; /******************************************************************************* * SDR Trunk diff --git a/src/dsp/filter/interpolator/RealInterpolator.java b/src/main/java/io/github/dsheirer/dsp/filter/interpolator/RealInterpolator.java similarity index 91% rename from src/dsp/filter/interpolator/RealInterpolator.java rename to src/main/java/io/github/dsheirer/dsp/filter/interpolator/RealInterpolator.java index 26941ac0..d0b99908 100644 --- a/src/dsp/filter/interpolator/RealInterpolator.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/interpolator/RealInterpolator.java @@ -1,11 +1,10 @@ -package dsp.filter.interpolator; +package io.github.dsheirer.dsp.filter.interpolator; +import io.github.dsheirer.sample.complex.Complex; import org.apache.commons.lang3.Validate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.complex.Complex; - public class RealInterpolator extends Interpolator { private final static Logger mLog = LoggerFactory.getLogger( RealInterpolator.class ); @@ -25,7 +24,7 @@ public class RealInterpolator extends Interpolator * * @param samples - sample array of length at least offset + 7 * - * @param mu - interpolated sample position between 0 and 1.0 + * @param mu - interpolated sample position between 0 and 1.0 * * @return - interpolated sample value */ diff --git a/src/dsp/filter/polyphase/FilterStage.java b/src/main/java/io/github/dsheirer/dsp/filter/polyphase/FilterStage.java similarity index 98% rename from src/dsp/filter/polyphase/FilterStage.java rename to src/main/java/io/github/dsheirer/dsp/filter/polyphase/FilterStage.java index 55a8556c..ffb1a411 100644 --- a/src/dsp/filter/polyphase/FilterStage.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/polyphase/FilterStage.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.filter.polyphase; +package io.github.dsheirer.dsp.filter.polyphase; public class FilterStage { diff --git a/src/dsp/filter/polyphase/PolyphaseFIRDecimatingFilter_RB.java b/src/main/java/io/github/dsheirer/dsp/filter/polyphase/PolyphaseFIRDecimatingFilter_RB.java similarity index 92% rename from src/dsp/filter/polyphase/PolyphaseFIRDecimatingFilter_RB.java rename to src/main/java/io/github/dsheirer/dsp/filter/polyphase/PolyphaseFIRDecimatingFilter_RB.java index b312cad2..0012b2c9 100644 --- a/src/dsp/filter/polyphase/PolyphaseFIRDecimatingFilter_RB.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/polyphase/PolyphaseFIRDecimatingFilter_RB.java @@ -15,19 +15,18 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.filter.polyphase; +package io.github.dsheirer.dsp.filter.polyphase; -import dsp.filter.design.FilterDesignException; -import dsp.filter.fir.FIRFilter; -import dsp.filter.fir.FIRFilterSpecification; -import dsp.filter.fir.remez.RemezFIRFilterDesigner; -import dsp.mixer.Oscillator; -import gui.SDRTrunk; +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 sample.Listener; -import sample.real.RealBuffer; -import sample.real.RealToRealBufferAssembler; import java.util.ArrayList; import java.util.Arrays; diff --git a/src/dsp/filter/polyphase/PolyphaseFIRInterpolatingFilter.java b/src/main/java/io/github/dsheirer/dsp/filter/polyphase/PolyphaseFIRInterpolatingFilter.java similarity index 98% rename from src/dsp/filter/polyphase/PolyphaseFIRInterpolatingFilter.java rename to src/main/java/io/github/dsheirer/dsp/filter/polyphase/PolyphaseFIRInterpolatingFilter.java index 992a14a6..73d84f06 100644 --- a/src/dsp/filter/polyphase/PolyphaseFIRInterpolatingFilter.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/polyphase/PolyphaseFIRInterpolatingFilter.java @@ -16,14 +16,14 @@ * along with this program. If not, see * ******************************************************************************/ -package dsp.filter.polyphase; +package io.github.dsheirer.dsp.filter.polyphase; import org.apache.commons.lang3.Validate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * Polyphase interpolating FIR filter with an internal circular buffer as + * Polyphase interpolating FIR filter with an internal circular buffer as * described by the dspGuru at: * * http://www.dspguru.com/dsp/faqs/multirate/interpolation @@ -40,13 +40,13 @@ public class PolyphaseFIRInterpolatingFilter private Phase[] mPhases; /** - * Constructs the interpolating filter. Coefficients length must be an + * Constructs the interpolating filter. Coefficients length must be an * integer multiple of the interpolation value. Each sample processed by * the filter will generate a quantity of samples equal to the interpolation * value. * * @param coefficients - low pass filter coefficients sized for the desired - * interpolated sample rate with a cutoff frequency of no more than half of + * interpolated sample rate with a cutoff frequency of no more than half of * the original sample rate. * * @param interpolation - integral interpolation quantity @@ -137,8 +137,8 @@ public class PolyphaseFIRInterpolatingFilter } /** - * Single phase element of a polyphase interpolating FIR filter. Each phase - * element shares a common buffer. The tap indexes argument defines the + * Single phase element of a polyphase interpolating FIR filter. Each phase + * element shares a common buffer. The tap indexes argument defines the * filter taps used by this phase element to generate an interpolated value * from the shared circular buffer of samples. */ diff --git a/src/dsp/filter/smoothing/GaussianSmoothingFilter.java b/src/main/java/io/github/dsheirer/dsp/filter/smoothing/GaussianSmoothingFilter.java similarity index 98% rename from src/dsp/filter/smoothing/GaussianSmoothingFilter.java rename to src/main/java/io/github/dsheirer/dsp/filter/smoothing/GaussianSmoothingFilter.java index d5cd52f7..c86b3743 100644 --- a/src/dsp/filter/smoothing/GaussianSmoothingFilter.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/smoothing/GaussianSmoothingFilter.java @@ -1,4 +1,4 @@ -package dsp.filter.smoothing; +package io.github.dsheirer.dsp.filter.smoothing; import java.util.HashMap; import java.util.Map; diff --git a/src/dsp/filter/smoothing/NoSmoothingFilter.java b/src/main/java/io/github/dsheirer/dsp/filter/smoothing/NoSmoothingFilter.java similarity index 89% rename from src/dsp/filter/smoothing/NoSmoothingFilter.java rename to src/main/java/io/github/dsheirer/dsp/filter/smoothing/NoSmoothingFilter.java index e7f09ea7..99de8990 100644 --- a/src/dsp/filter/smoothing/NoSmoothingFilter.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/smoothing/NoSmoothingFilter.java @@ -1,4 +1,4 @@ -package dsp.filter.smoothing; +package io.github.dsheirer.dsp.filter.smoothing; public class NoSmoothingFilter extends SmoothingFilter diff --git a/src/dsp/filter/smoothing/RectangularSmoothingFilter.java b/src/main/java/io/github/dsheirer/dsp/filter/smoothing/RectangularSmoothingFilter.java similarity index 95% rename from src/dsp/filter/smoothing/RectangularSmoothingFilter.java rename to src/main/java/io/github/dsheirer/dsp/filter/smoothing/RectangularSmoothingFilter.java index 4ae92726..2c73e7d0 100644 --- a/src/dsp/filter/smoothing/RectangularSmoothingFilter.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/smoothing/RectangularSmoothingFilter.java @@ -1,4 +1,4 @@ -package dsp.filter.smoothing; +package io.github.dsheirer.dsp.filter.smoothing; import java.util.Arrays; import java.util.HashMap; diff --git a/src/dsp/filter/smoothing/SmoothingFilter.java b/src/main/java/io/github/dsheirer/dsp/filter/smoothing/SmoothingFilter.java similarity index 97% rename from src/dsp/filter/smoothing/SmoothingFilter.java rename to src/main/java/io/github/dsheirer/dsp/filter/smoothing/SmoothingFilter.java index b9e7a953..e7ee913d 100644 --- a/src/dsp/filter/smoothing/SmoothingFilter.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/smoothing/SmoothingFilter.java @@ -1,4 +1,4 @@ -package dsp.filter.smoothing; +package io.github.dsheirer.dsp.filter.smoothing; import java.util.Map; import java.util.Set; diff --git a/src/dsp/filter/smoothing/TriangularSmoothingFilter.java b/src/main/java/io/github/dsheirer/dsp/filter/smoothing/TriangularSmoothingFilter.java similarity index 98% rename from src/dsp/filter/smoothing/TriangularSmoothingFilter.java rename to src/main/java/io/github/dsheirer/dsp/filter/smoothing/TriangularSmoothingFilter.java index 29bdc9c7..bef929e2 100644 --- a/src/dsp/filter/smoothing/TriangularSmoothingFilter.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/smoothing/TriangularSmoothingFilter.java @@ -1,4 +1,4 @@ -package dsp.filter.smoothing; +package io.github.dsheirer.dsp.filter.smoothing; import java.util.HashMap; import java.util.Map; diff --git a/src/dsp/fm/FMDemodulator.java b/src/main/java/io/github/dsheirer/dsp/fm/FMDemodulator.java similarity index 98% rename from src/dsp/fm/FMDemodulator.java rename to src/main/java/io/github/dsheirer/dsp/fm/FMDemodulator.java index 238915bb..30049836 100644 --- a/src/dsp/fm/FMDemodulator.java +++ b/src/main/java/io/github/dsheirer/dsp/fm/FMDemodulator.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.fm; +package io.github.dsheirer.dsp.fm; public abstract class FMDemodulator { @@ -31,7 +31,7 @@ public abstract class FMDemodulator public float demodulate( float currentI, float currentQ ) { /** - * Multiply the current sample against the complex conjugate of the + * Multiply the current sample against the complex conjugate of the * previous sample to derive the phase delta between the two samples * * Negating the previous sample quadrature produces the conjugate diff --git a/src/dsp/fm/FMDemodulator_CB.java b/src/main/java/io/github/dsheirer/dsp/fm/FMDemodulator_CB.java similarity index 89% rename from src/dsp/fm/FMDemodulator_CB.java rename to src/main/java/io/github/dsheirer/dsp/fm/FMDemodulator_CB.java index 55b58c6e..a11620a2 100644 --- a/src/dsp/fm/FMDemodulator_CB.java +++ b/src/main/java/io/github/dsheirer/dsp/fm/FMDemodulator_CB.java @@ -15,16 +15,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.fm; +package io.github.dsheirer.dsp.fm; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.ComplexBuffer; +import io.github.dsheirer.sample.real.RateCounter_RB; +import io.github.dsheirer.sample.real.RealBuffer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; -import sample.complex.ComplexBuffer; -import sample.real.RateCounter_RB; -import sample.real.RealBuffer; - public class FMDemodulator_CB extends FMDemodulator implements Listener { private final static Logger mLog = diff --git a/src/dsp/fm/FMDiscriminator.java b/src/main/java/io/github/dsheirer/dsp/fm/FMDiscriminator.java similarity index 93% rename from src/dsp/fm/FMDiscriminator.java rename to src/main/java/io/github/dsheirer/dsp/fm/FMDiscriminator.java index 3e32d2d2..5d157f87 100644 --- a/src/dsp/fm/FMDiscriminator.java +++ b/src/main/java/io/github/dsheirer/dsp/fm/FMDiscriminator.java @@ -15,11 +15,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.fm; +package io.github.dsheirer.dsp.fm; -import sample.Listener; -import sample.complex.Complex; -import sample.real.RealSampleListener; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.Complex; +import io.github.dsheirer.sample.real.RealSampleListener; @Deprecated public class FMDiscriminator implements Listener @@ -55,7 +55,7 @@ public class FMDiscriminator implements Listener public void receive( Complex currentSample ) { /** - * Multiply the current sample against the complex conjugate of the + * Multiply the current sample against the complex conjugate of the * previous sample to derive the phase delta between the two samples * * Negating the previous sample quadrature produces the conjugate diff --git a/src/dsp/fsk/FSK2Decoder.java b/src/main/java/io/github/dsheirer/dsp/fsk/FSK2Decoder.java similarity index 94% rename from src/dsp/fsk/FSK2Decoder.java rename to src/main/java/io/github/dsheirer/dsp/fsk/FSK2Decoder.java index 2a429546..142201f5 100644 --- a/src/dsp/fsk/FSK2Decoder.java +++ b/src/main/java/io/github/dsheirer/dsp/fsk/FSK2Decoder.java @@ -15,19 +15,19 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.fsk; +package io.github.dsheirer.dsp.fsk; -import buffer.BooleanAveragingBuffer; -import dsp.symbol.SymbolEvent; -import dsp.symbol.SymbolEvent.Shift; -import instrument.Instrumentable; -import instrument.tap.Tap; -import instrument.tap.TapGroup; -import instrument.tap.stream.SymbolEventTap; +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; +import io.github.dsheirer.instrument.tap.stream.SymbolEventTap; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.RealBuffer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; -import sample.real.RealBuffer; import java.util.ArrayList; import java.util.BitSet; @@ -106,7 +106,7 @@ public class FSK2Decoder implements Instrumentable, Listener { for(float sample : buffer.getSamples()) { - /* Square the sample. Greater than zero is a 1 (true) and less than + /* Square the sample. Greater than zero is a 1 (true) and less than * zero is a 0 (false) */ boolean bitSample = (sample >= 0.0f); diff --git a/src/dsp/fsk/LTRFSKDecoder.java b/src/main/java/io/github/dsheirer/dsp/fsk/LTRFSKDecoder.java similarity index 87% rename from src/dsp/fsk/LTRFSKDecoder.java rename to src/main/java/io/github/dsheirer/dsp/fsk/LTRFSKDecoder.java index 118ea13f..6e473ba6 100644 --- a/src/dsp/fsk/LTRFSKDecoder.java +++ b/src/main/java/io/github/dsheirer/dsp/fsk/LTRFSKDecoder.java @@ -15,31 +15,31 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.fsk; +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; +import io.github.dsheirer.instrument.tap.stream.BinaryTap; +import io.github.dsheirer.instrument.tap.stream.FloatBufferTap; +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 java.util.ArrayList; import java.util.List; -import dsp.filter.Filters; -import dsp.filter.FloatHalfBandFilter; -import dsp.filter.FloatHalfBandNoDecimateFilter; -import dsp.filter.LTRPulseShapingFilter; -import dsp.filter.SquaringFilter; -import dsp.filter.Window.WindowType; -import dsp.filter.cic.RealPrimeCICDecimate; -import dsp.filter.dc.IIRSinglePoleDCRemovalFilter; -import dsp.symbol.Slicer; -import dsp.symbol.Slicer.Output; -import instrument.Instrumentable; -import instrument.tap.Tap; -import instrument.tap.TapGroup; -import instrument.tap.stream.BinaryTap; -import instrument.tap.stream.FloatBufferTap; -import instrument.tap.stream.FloatTap; -import instrument.tap.stream.SymbolEventTap; -import sample.Listener; -import sample.real.RealBuffer; - public class LTRFSKDecoder implements Listener, Instrumentable { private RealPrimeCICDecimate mCICDecimator; diff --git a/src/dsp/gain/AutomaticGainControl.java b/src/main/java/io/github/dsheirer/dsp/gain/AutomaticGainControl.java similarity index 97% rename from src/dsp/gain/AutomaticGainControl.java rename to src/main/java/io/github/dsheirer/dsp/gain/AutomaticGainControl.java index 8f397ebd..d6873037 100644 --- a/src/dsp/gain/AutomaticGainControl.java +++ b/src/main/java/io/github/dsheirer/dsp/gain/AutomaticGainControl.java @@ -1,10 +1,10 @@ -package dsp.gain; +package io.github.dsheirer.dsp.gain; + +import io.github.dsheirer.buffer.DoubleCircularBuffer; +import io.github.dsheirer.buffer.FloatCircularBuffer; import java.util.concurrent.atomic.AtomicBoolean; -import buffer.DoubleCircularBuffer; -import buffer.FloatCircularBuffer; - /******************************************************************************* * SDR Trunk * Copyright (C) 2014 Dennis Sheirer @@ -31,11 +31,11 @@ import buffer.FloatCircularBuffer; * This Software is released under the "Simplified BSD License" + + + * Copyright 2010 Moe Wheatley. All rights reserved. * - * Redistribution and use in source and binary forms, with or without + * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * - * 1. Redistributions of source code must retain the above copyright notice, + * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright diff --git a/src/dsp/gain/AutomaticGainControl_RB.java b/src/main/java/io/github/dsheirer/dsp/gain/AutomaticGainControl_RB.java similarity index 86% rename from src/dsp/gain/AutomaticGainControl_RB.java rename to src/main/java/io/github/dsheirer/dsp/gain/AutomaticGainControl_RB.java index e96c600a..46152564 100644 --- a/src/dsp/gain/AutomaticGainControl_RB.java +++ b/src/main/java/io/github/dsheirer/dsp/gain/AutomaticGainControl_RB.java @@ -1,7 +1,7 @@ -package dsp.gain; +package io.github.dsheirer.dsp.gain; -import sample.Listener; -import sample.real.RealBuffer; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.RealBuffer; public class AutomaticGainControl_RB extends AutomaticGainControl implements Listener diff --git a/src/dsp/gain/ComplexAutomaticGainControl.java b/src/main/java/io/github/dsheirer/dsp/gain/ComplexAutomaticGainControl.java similarity index 96% rename from src/dsp/gain/ComplexAutomaticGainControl.java rename to src/main/java/io/github/dsheirer/dsp/gain/ComplexAutomaticGainControl.java index 3fc0d563..a3431f6d 100644 --- a/src/dsp/gain/ComplexAutomaticGainControl.java +++ b/src/main/java/io/github/dsheirer/dsp/gain/ComplexAutomaticGainControl.java @@ -1,13 +1,13 @@ -package dsp.gain; +package io.github.dsheirer.dsp.gain; + +import io.github.dsheirer.buffer.ComplexCircularBuffer; +import io.github.dsheirer.buffer.DoubleCircularBuffer; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.Provider; +import io.github.dsheirer.sample.complex.Complex; import java.util.concurrent.atomic.AtomicBoolean; -import sample.Listener; -import sample.Provider; -import sample.complex.Complex; -import buffer.ComplexCircularBuffer; -import buffer.DoubleCircularBuffer; - /******************************************************************************* * SDR Trunk * Copyright (C) 2014 Dennis Sheirer @@ -34,11 +34,11 @@ import buffer.DoubleCircularBuffer; * This Software is released under the "Simplified BSD License" + + + * Copyright 2010 Moe Wheatley. All rights reserved. * - * Redistribution and use in source and binary forms, with or without + * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * - * 1. Redistributions of source code must retain the above copyright notice, + * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright diff --git a/src/dsp/gain/ComplexFeedForwardGainControl.java b/src/main/java/io/github/dsheirer/dsp/gain/ComplexFeedForwardGainControl.java similarity index 94% rename from src/dsp/gain/ComplexFeedForwardGainControl.java rename to src/main/java/io/github/dsheirer/dsp/gain/ComplexFeedForwardGainControl.java index 6abcd62c..c939b952 100644 --- a/src/dsp/gain/ComplexFeedForwardGainControl.java +++ b/src/main/java/io/github/dsheirer/dsp/gain/ComplexFeedForwardGainControl.java @@ -1,8 +1,8 @@ -package dsp.gain; +package io.github.dsheirer.dsp.gain; -import sample.complex.Complex; -import sample.complex.ComplexSampleListener; -import buffer.FloatCircularBuffer; +import io.github.dsheirer.buffer.FloatCircularBuffer; +import io.github.dsheirer.sample.complex.Complex; +import io.github.dsheirer.sample.complex.ComplexSampleListener; /******************************************************************************* * SDR Trunk diff --git a/src/dsp/gain/ComplexGain.java b/src/main/java/io/github/dsheirer/dsp/gain/ComplexGain.java similarity index 76% rename from src/dsp/gain/ComplexGain.java rename to src/main/java/io/github/dsheirer/dsp/gain/ComplexGain.java index e86e0048..f10b571b 100644 --- a/src/dsp/gain/ComplexGain.java +++ b/src/main/java/io/github/dsheirer/dsp/gain/ComplexGain.java @@ -1,7 +1,7 @@ -package dsp.gain; +package io.github.dsheirer.dsp.gain; -import sample.Listener; -import sample.complex.Complex; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.Complex; public class ComplexGain implements Listener { diff --git a/src/dsp/gain/DirectGainControl.java b/src/main/java/io/github/dsheirer/dsp/gain/DirectGainControl.java similarity index 96% rename from src/dsp/gain/DirectGainControl.java rename to src/main/java/io/github/dsheirer/dsp/gain/DirectGainControl.java index 01c167c8..1754fdc9 100644 --- a/src/dsp/gain/DirectGainControl.java +++ b/src/main/java/io/github/dsheirer/dsp/gain/DirectGainControl.java @@ -15,14 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.gain; +package io.github.dsheirer.dsp.gain; +import io.github.dsheirer.sample.real.RealSampleListener; import org.apache.commons.lang3.Validate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.real.RealSampleListener; - public class DirectGainControl implements GainController, RealSampleListener { private final static Logger mLog = diff --git a/src/dsp/gain/GainController.java b/src/main/java/io/github/dsheirer/dsp/gain/GainController.java similarity index 78% rename from src/dsp/gain/GainController.java rename to src/main/java/io/github/dsheirer/dsp/gain/GainController.java index a38bc3fe..5026174c 100644 --- a/src/dsp/gain/GainController.java +++ b/src/main/java/io/github/dsheirer/dsp/gain/GainController.java @@ -1,4 +1,4 @@ -package dsp.gain; +package io.github.dsheirer.dsp.gain; public interface GainController { diff --git a/src/dsp/gain/NonClippingGain.java b/src/main/java/io/github/dsheirer/dsp/gain/NonClippingGain.java similarity index 92% rename from src/dsp/gain/NonClippingGain.java rename to src/main/java/io/github/dsheirer/dsp/gain/NonClippingGain.java index ef1a7bcd..ebfab2df 100644 --- a/src/dsp/gain/NonClippingGain.java +++ b/src/main/java/io/github/dsheirer/dsp/gain/NonClippingGain.java @@ -1,6 +1,6 @@ -package dsp.gain; +package io.github.dsheirer.dsp.gain; -import sample.real.RealBuffer; +import io.github.dsheirer.sample.real.RealBuffer; public class NonClippingGain { diff --git a/src/dsp/mixer/Oscillator.java b/src/main/java/io/github/dsheirer/dsp/mixer/Oscillator.java similarity index 96% rename from src/dsp/mixer/Oscillator.java rename to src/main/java/io/github/dsheirer/dsp/mixer/Oscillator.java index 19736800..50511208 100644 --- a/src/dsp/mixer/Oscillator.java +++ b/src/main/java/io/github/dsheirer/dsp/mixer/Oscillator.java @@ -15,13 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.mixer; +package io.github.dsheirer.dsp.mixer; +import io.github.dsheirer.sample.complex.Complex; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.complex.Complex; - public class Oscillator { private final static Logger mLog = LoggerFactory.getLogger( Oscillator.class ); diff --git a/src/dsp/psk/LSMDemodulator.java b/src/main/java/io/github/dsheirer/dsp/psk/LSMDemodulator.java similarity index 95% rename from src/dsp/psk/LSMDemodulator.java rename to src/main/java/io/github/dsheirer/dsp/psk/LSMDemodulator.java index 5142d0d9..030ef0d8 100644 --- a/src/dsp/psk/LSMDemodulator.java +++ b/src/main/java/io/github/dsheirer/dsp/psk/LSMDemodulator.java @@ -1,4 +1,4 @@ -package dsp.psk; +package io.github.dsheirer.dsp.psk; /******************************************************************************* * SDR Trunk @@ -30,24 +30,23 @@ package dsp.psk; * along with this program. If not, see ******************************************************************************/ -import instrument.Instrumentable; -import instrument.tap.Tap; -import instrument.tap.TapGroup; -import instrument.tap.stream.EyeDiagramData; -import instrument.tap.stream.EyeDiagramDataTap; +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; +import io.github.dsheirer.instrument.tap.stream.EyeDiagramData; +import io.github.dsheirer.instrument.tap.stream.EyeDiagramDataTap; +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 java.util.ArrayList; import java.util.Arrays; import java.util.List; -import sample.Listener; -import sample.complex.Complex; -import sample.complex.ComplexSampleListener; -import source.tuner.frequency.IFrequencyChangeListener; -import buffer.FloatAveragingBuffer; -import dsp.filter.interpolator.RealInterpolator; -import dsp.symbol.Dibit; - /** * Implements a LSM (Pi/4) demodulator using a Gardner Detector to determine * optimal sampling timing and a Costas Loop as a phase locked loop synchronized @@ -261,7 +260,7 @@ public class LSMDemodulator implements Instrumentable, ComplexSampleListener mCostasLoop.increment(); - /* Mix incoming sample with costas loop to remove any rotation + /* Mix incoming sample with costas loop to remove any rotation * that is present from a mis-tuned carrier frequency */ Complex costas = mCostasLoop.getCurrentVector(); @@ -305,7 +304,7 @@ public class LSMDemodulator implements Instrumentable, ComplexSampleListener float currentSampleQuadrature = mInterpolator.filter( mDelayLineQuadrature, index, half_mu ); - /* Multiply current sample and conjugate (negated quadrature) of + /* Multiply current sample and conjugate (negated quadrature) of * previous sample to get symbols to use for gardner error feedback */ Complex middleSymbol = Complex.multiply( middleSampleInphase, middleSampleQuadrature, mPreviousMiddleSample.conjugate() ); diff --git a/src/dsp/psk/QPSKPolarSlicer.java b/src/main/java/io/github/dsheirer/dsp/psk/QPSKPolarSlicer.java similarity index 90% rename from src/dsp/psk/QPSKPolarSlicer.java rename to src/main/java/io/github/dsheirer/dsp/psk/QPSKPolarSlicer.java index db6469e6..3ff0c708 100644 --- a/src/dsp/psk/QPSKPolarSlicer.java +++ b/src/main/java/io/github/dsheirer/dsp/psk/QPSKPolarSlicer.java @@ -1,9 +1,9 @@ -package dsp.psk; +package io.github.dsheirer.dsp.psk; -import sample.Broadcaster; -import sample.Listener; -import sample.complex.Complex; -import dsp.symbol.Dibit; +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; /******************************************************************************* * SDR Trunk diff --git a/src/dsp/psk/QPSKStarSlicer.java b/src/main/java/io/github/dsheirer/dsp/psk/QPSKStarSlicer.java similarity index 81% rename from src/dsp/psk/QPSKStarSlicer.java rename to src/main/java/io/github/dsheirer/dsp/psk/QPSKStarSlicer.java index 7f16f38d..f6b23861 100644 --- a/src/dsp/psk/QPSKStarSlicer.java +++ b/src/main/java/io/github/dsheirer/dsp/psk/QPSKStarSlicer.java @@ -1,9 +1,9 @@ -package dsp.psk; +package io.github.dsheirer.dsp.psk; -import sample.Broadcaster; -import sample.Listener; -import sample.complex.Complex; -import dsp.symbol.Dibit; +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; public class QPSKStarSlicer implements Listener { diff --git a/src/dsp/symbol/Dibit.java b/src/main/java/io/github/dsheirer/dsp/symbol/Dibit.java similarity index 98% rename from src/dsp/symbol/Dibit.java rename to src/main/java/io/github/dsheirer/dsp/symbol/Dibit.java index d2d86b18..8ec42ec7 100644 --- a/src/dsp/symbol/Dibit.java +++ b/src/main/java/io/github/dsheirer/dsp/symbol/Dibit.java @@ -1,4 +1,4 @@ -package dsp.symbol; +package io.github.dsheirer.dsp.symbol; public enum Dibit { diff --git a/src/dsp/symbol/FrameSync.java b/src/main/java/io/github/dsheirer/dsp/symbol/FrameSync.java similarity index 90% rename from src/dsp/symbol/FrameSync.java rename to src/main/java/io/github/dsheirer/dsp/symbol/FrameSync.java index 66eb611f..d4d82fb9 100644 --- a/src/dsp/symbol/FrameSync.java +++ b/src/main/java/io/github/dsheirer/dsp/symbol/FrameSync.java @@ -1,4 +1,4 @@ -package dsp.symbol; +package io.github.dsheirer.dsp.symbol; public enum FrameSync { diff --git a/src/dsp/symbol/Slicer.java b/src/main/java/io/github/dsheirer/dsp/symbol/Slicer.java similarity index 86% rename from src/dsp/symbol/Slicer.java rename to src/main/java/io/github/dsheirer/dsp/symbol/Slicer.java index 8b9a1455..a122ee42 100644 --- a/src/dsp/symbol/Slicer.java +++ b/src/main/java/io/github/dsheirer/dsp/symbol/Slicer.java @@ -1,12 +1,10 @@ -package dsp.symbol; +package io.github.dsheirer.dsp.symbol; -import instrument.tap.stream.SymbolEventTap; +import io.github.dsheirer.instrument.tap.stream.SymbolEventTap; +import io.github.dsheirer.sample.Listener; import java.util.BitSet; -import sample.Listener; -import dsp.symbol.SymbolEvent.Shift; - /** * Symbol slicer with auto-aligning baud timing */ @@ -60,7 +58,7 @@ public class Slicer implements Listener if( ( mBitSet.get( 0 ) ^ decision ) && ( !( mBitSet.get( mSymbolLength - 1 ) ^ decision ) ) ) { - sendTapEvent( mBitSet, Shift.LEFT, decision ); + sendTapEvent( mBitSet, SymbolEvent.Shift.LEFT, decision ); reset(); @@ -71,7 +69,7 @@ public class Slicer implements Listener else if( ( !( mBitSet.get( 0 ) ^ decision ) ) && ( mBitSet.get( mSymbolLength - 1 ) ^ decision ) ) { - sendTapEvent( mBitSet, Shift.RIGHT, decision ); + sendTapEvent( mBitSet, SymbolEvent.Shift.RIGHT, decision ); /* Last bit from previous symbol to pre-fill next symbol */ boolean previousSoftBit = mBitSet.get( mSymbolLength - 1 ); @@ -88,7 +86,7 @@ public class Slicer implements Listener /* No shift */ else { - sendTapEvent( mBitSet, Shift.NONE, decision ); + sendTapEvent( mBitSet, SymbolEvent.Shift.NONE, decision ); reset(); } @@ -125,7 +123,7 @@ public class Slicer implements Listener /** * Sends instrumentation tap event to all registered listeners */ - private void sendTapEvent( BitSet bitset, Shift shift, boolean decision ) + private void sendTapEvent(BitSet bitset, SymbolEvent.Shift shift, boolean decision ) { if( mSymbolEventTap != null ) { diff --git a/src/dsp/symbol/SymbolEvent.java b/src/main/java/io/github/dsheirer/dsp/symbol/SymbolEvent.java similarity index 97% rename from src/dsp/symbol/SymbolEvent.java rename to src/main/java/io/github/dsheirer/dsp/symbol/SymbolEvent.java index 5bcd3495..d5dde39f 100644 --- a/src/dsp/symbol/SymbolEvent.java +++ b/src/main/java/io/github/dsheirer/dsp/symbol/SymbolEvent.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.symbol; +package io.github.dsheirer.dsp.symbol; import java.util.BitSet; diff --git a/src/dsp/symbol/SyncDetectListener.java b/src/main/java/io/github/dsheirer/dsp/symbol/SyncDetectListener.java similarity index 96% rename from src/dsp/symbol/SyncDetectListener.java rename to src/main/java/io/github/dsheirer/dsp/symbol/SyncDetectListener.java index 633cc964..942c1635 100644 --- a/src/dsp/symbol/SyncDetectListener.java +++ b/src/main/java/io/github/dsheirer/dsp/symbol/SyncDetectListener.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.symbol; +package io.github.dsheirer.dsp.symbol; /** * Interface to allow an external process indicate that it has detected a diff --git a/src/dsp/symbol/SyncDetectProvider.java b/src/main/java/io/github/dsheirer/dsp/symbol/SyncDetectProvider.java similarity index 96% rename from src/dsp/symbol/SyncDetectProvider.java rename to src/main/java/io/github/dsheirer/dsp/symbol/SyncDetectProvider.java index 10001c96..69dc7043 100644 --- a/src/dsp/symbol/SyncDetectProvider.java +++ b/src/main/java/io/github/dsheirer/dsp/symbol/SyncDetectProvider.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package dsp.symbol; +package io.github.dsheirer.dsp.symbol; public interface SyncDetectProvider diff --git a/src/edac/BCH_63_16_11.java b/src/main/java/io/github/dsheirer/edac/BCH_63_16_11.java similarity index 97% rename from src/edac/BCH_63_16_11.java rename to src/main/java/io/github/dsheirer/edac/BCH_63_16_11.java index 6807bfca..e6eb9e5a 100644 --- a/src/edac/BCH_63_16_11.java +++ b/src/main/java/io/github/dsheirer/edac/BCH_63_16_11.java @@ -1,10 +1,9 @@ -package edac; +package io.github.dsheirer.edac; +import io.github.dsheirer.bits.BinaryMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import bits.BinaryMessage; - /******************************************************************************* * SDR Trunk * Copyright (C) 2014 Dennis Sheirer @@ -37,7 +36,7 @@ public class BCH_63_16_11 extends BerlekempMassey_63 } /** - * Performs error detection and correction on the first 63 bits of the + * Performs error detection and correction on the first 63 bits of the * message argument. If the message is correctable, only the first 16 bits * (information bits) are corrected. * diff --git a/src/edac/BerlekempMassey_63.java b/src/main/java/io/github/dsheirer/edac/BerlekempMassey_63.java similarity index 99% rename from src/edac/BerlekempMassey_63.java rename to src/main/java/io/github/dsheirer/edac/BerlekempMassey_63.java index 5fa014a9..a21006e5 100644 --- a/src/edac/BerlekempMassey_63.java +++ b/src/main/java/io/github/dsheirer/edac/BerlekempMassey_63.java @@ -1,4 +1,4 @@ -package edac; +package io.github.dsheirer.edac; /******************************************************************************* * SDR Trunk diff --git a/src/edac/CRC.java b/src/main/java/io/github/dsheirer/edac/CRC.java similarity index 98% rename from src/edac/CRC.java rename to src/main/java/io/github/dsheirer/edac/CRC.java index c81f7b80..15c8cc26 100644 --- a/src/edac/CRC.java +++ b/src/main/java/io/github/dsheirer/edac/CRC.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package edac; +package io.github.dsheirer.edac; public enum CRC { diff --git a/src/edac/CRCFleetsync.java b/src/main/java/io/github/dsheirer/edac/CRCFleetsync.java similarity index 99% rename from src/edac/CRCFleetsync.java rename to src/main/java/io/github/dsheirer/edac/CRCFleetsync.java index eb936dc2..5cd172ab 100644 --- a/src/edac/CRCFleetsync.java +++ b/src/main/java/io/github/dsheirer/edac/CRCFleetsync.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package edac; +package io.github.dsheirer.edac; import java.util.BitSet; @@ -103,7 +103,7 @@ public class CRCFleetsync }; /** - * Determines if message bits 0 - 47 pass the Fleetsync CRC checksum + * Determines if message bits 0 - 47 pass the Fleetsync CRC checksum * contained in bits 48 - 63, using a lookup table of CRC checksum values * derived from the CRC-15 value, and verifies the message has even parity */ diff --git a/src/edac/CRCLJ.java b/src/main/java/io/github/dsheirer/edac/CRCLJ.java similarity index 98% rename from src/edac/CRCLJ.java rename to src/main/java/io/github/dsheirer/edac/CRCLJ.java index 8648f0ee..d00864d2 100644 --- a/src/edac/CRCLJ.java +++ b/src/main/java/io/github/dsheirer/edac/CRCLJ.java @@ -15,14 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package edac; - -import java.util.BitSet; +package io.github.dsheirer.edac; +import io.github.dsheirer.bits.BinaryMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import bits.BinaryMessage; +import java.util.BitSet; /** * LJ CRC checksum utility @@ -105,7 +104,7 @@ public class CRCLJ }; /** - * Determines if FUNCTION AND ADDRESS bits pass the LJ CRC checksum + * Determines if FUNCTION AND ADDRESS bits pass the LJ CRC checksum * using a lookup table of CRC checksum values derived from the CRC-16 value */ public static CRC checkAndCorrect( BinaryMessage message ) diff --git a/src/edac/CRCLTR.java b/src/main/java/io/github/dsheirer/edac/CRCLTR.java similarity index 98% rename from src/edac/CRCLTR.java rename to src/main/java/io/github/dsheirer/edac/CRCLTR.java index 1440a7f5..32428494 100644 --- a/src/edac/CRCLTR.java +++ b/src/main/java/io/github/dsheirer/edac/CRCLTR.java @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package edac; +package io.github.dsheirer.edac; + +import io.github.dsheirer.message.MessageDirection; import java.util.BitSet; -import message.MessageDirection; - /** * LTR CRC checksum utility * @@ -64,7 +64,7 @@ public class CRCLTR }; /** - * Determines if message bits 10 - 34 pass the LTR CRC checksum + * Determines if message bits 10 - 34 pass the LTR CRC checksum * contained in bits 35 - 41, using a lookup table of CRC checksum values * derived from the CRC-7 value. */ diff --git a/src/edac/CRCP25.java b/src/main/java/io/github/dsheirer/edac/CRCP25.java similarity index 99% rename from src/edac/CRCP25.java rename to src/main/java/io/github/dsheirer/edac/CRCP25.java index ee0eae5e..f98c5a74 100644 --- a/src/edac/CRCP25.java +++ b/src/main/java/io/github/dsheirer/edac/CRCP25.java @@ -15,13 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package edac; +package io.github.dsheirer.edac; +import io.github.dsheirer.bits.BinaryMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import bits.BinaryMessage; - /** * P25 CRC check/correction methods */ diff --git a/src/edac/CRCPassport.java b/src/main/java/io/github/dsheirer/edac/CRCPassport.java similarity index 97% rename from src/edac/CRCPassport.java rename to src/main/java/io/github/dsheirer/edac/CRCPassport.java index c652064d..5591cb31 100644 --- a/src/edac/CRCPassport.java +++ b/src/main/java/io/github/dsheirer/edac/CRCPassport.java @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package edac; +package io.github.dsheirer.edac; + +import io.github.dsheirer.bits.BinaryMessage; import java.util.BitSet; -import bits.BinaryMessage; - /** * Passport CRC checksum utility * @@ -93,7 +93,7 @@ public class CRCPassport }; /** - * Determines if message bits 9 - 59 pass the CRC checksum + * Determines if message bits 9 - 59 pass the CRC checksum * contained in bits 60 - 68, using a lookup table of CRC checksum values * derived from the CRC-7 value and the final parity bit */ diff --git a/src/edac/CRCUtil.java b/src/main/java/io/github/dsheirer/edac/CRCUtil.java similarity index 98% rename from src/edac/CRCUtil.java rename to src/main/java/io/github/dsheirer/edac/CRCUtil.java index aaed8a0b..be5b31bd 100644 --- a/src/edac/CRCUtil.java +++ b/src/main/java/io/github/dsheirer/edac/CRCUtil.java @@ -15,13 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package edac; +package io.github.dsheirer.edac; +import io.github.dsheirer.bits.BinaryMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import bits.BinaryMessage; - public class CRCUtil { private final static Logger mLog = LoggerFactory.getLogger( CRCUtil.class ); @@ -127,7 +126,7 @@ public class CRCUtil * @param polynomial - crc polynomial - must be 1 bit longer than the crc width * @param messageSize - message length and start of the checksum * - * @return message with all message bits zeroed out, and the remainder + * @return message with all message bits zeroed out, and the remainder * placed in the crc field which starts at index messageLength */ public static BinaryMessage decode( BinaryMessage message, diff --git a/src/edac/Checksum.java b/src/main/java/io/github/dsheirer/edac/Checksum.java similarity index 97% rename from src/edac/Checksum.java rename to src/main/java/io/github/dsheirer/edac/Checksum.java index a80b5841..d0ce827e 100644 --- a/src/edac/Checksum.java +++ b/src/main/java/io/github/dsheirer/edac/Checksum.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package edac; +package io.github.dsheirer.edac; import java.util.BitSet; diff --git a/src/edac/ChecksumTest.java b/src/main/java/io/github/dsheirer/edac/ChecksumTest.java similarity index 98% rename from src/edac/ChecksumTest.java rename to src/main/java/io/github/dsheirer/edac/ChecksumTest.java index 0d645f5e..4254c558 100644 --- a/src/edac/ChecksumTest.java +++ b/src/main/java/io/github/dsheirer/edac/ChecksumTest.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package edac; +package io.github.dsheirer.edac; import java.util.BitSet; diff --git a/src/edac/ChecksumType.java b/src/main/java/io/github/dsheirer/edac/ChecksumType.java similarity index 99% rename from src/edac/ChecksumType.java rename to src/main/java/io/github/dsheirer/edac/ChecksumType.java index af47d73b..16c0ca6a 100644 --- a/src/edac/ChecksumType.java +++ b/src/main/java/io/github/dsheirer/edac/ChecksumType.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package edac; +package io.github.dsheirer.edac; public enum ChecksumType { diff --git a/src/edac/Golay18.java b/src/main/java/io/github/dsheirer/edac/Golay18.java similarity index 95% rename from src/edac/Golay18.java rename to src/main/java/io/github/dsheirer/edac/Golay18.java index b374de50..17a91c25 100644 --- a/src/edac/Golay18.java +++ b/src/main/java/io/github/dsheirer/edac/Golay18.java @@ -1,10 +1,9 @@ -package edac; +package io.github.dsheirer.edac; +import io.github.dsheirer.bits.BinaryMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import bits.BinaryMessage; - /******************************************************************************* * SDR Trunk * Copyright (C) 2014 Dennis Sheirer @@ -28,7 +27,7 @@ import bits.BinaryMessage; /** * Golay 18/6/8 decoder. Uses the Golay24 edac class to perform edac on Golay - * 18 messages by treating the Golay 18 message as a Golay 24 message with the + * 18 messages by treating the Golay 18 message as a Golay 24 message with the * left-most 6 bits set to zero. */ public class Golay18 diff --git a/src/edac/Golay23.java b/src/main/java/io/github/dsheirer/edac/Golay23.java similarity index 97% rename from src/edac/Golay23.java rename to src/main/java/io/github/dsheirer/edac/Golay23.java index b5173958..ae1897b7 100644 --- a/src/edac/Golay23.java +++ b/src/main/java/io/github/dsheirer/edac/Golay23.java @@ -1,6 +1,6 @@ -package edac; +package io.github.dsheirer.edac; -import bits.BinaryMessage; +import io.github.dsheirer.bits.BinaryMessage; public class Golay23 { @@ -16,7 +16,7 @@ public class Golay23 /** * Implements Golay(23,12,7) error detection and correction. Returns the * number of detected errors. If the error count is less than or equal to - * the max correctable errors (3), then the error bits are corrected. + * the max correctable errors (3), then the error bits are corrected. * Otherwise the message is left intact and an error count greater than 3 * is returned. * diff --git a/src/edac/Golay24.java b/src/main/java/io/github/dsheirer/edac/Golay24.java similarity index 98% rename from src/edac/Golay24.java rename to src/main/java/io/github/dsheirer/edac/Golay24.java index 6ec20ba7..6d1da2bb 100644 --- a/src/edac/Golay24.java +++ b/src/main/java/io/github/dsheirer/edac/Golay24.java @@ -1,10 +1,9 @@ -package edac; +package io.github.dsheirer.edac; +import io.github.dsheirer.bits.BinaryMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import bits.BinaryMessage; - /******************************************************************************* * SDR Trunk * Copyright (C) 2014 Dennis Sheirer diff --git a/src/edac/Hamming10.java b/src/main/java/io/github/dsheirer/edac/Hamming10.java similarity index 97% rename from src/edac/Hamming10.java rename to src/main/java/io/github/dsheirer/edac/Hamming10.java index b1b2b17e..979e10dd 100644 --- a/src/edac/Hamming10.java +++ b/src/main/java/io/github/dsheirer/edac/Hamming10.java @@ -1,10 +1,9 @@ -package edac; +package io.github.dsheirer.edac; +import io.github.dsheirer.bits.BinaryMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import bits.BinaryMessage; - public class Hamming10 { private final static Logger mLog = LoggerFactory.getLogger( Hamming10.class ); diff --git a/src/edac/Hamming15.java b/src/main/java/io/github/dsheirer/edac/Hamming15.java similarity index 97% rename from src/edac/Hamming15.java rename to src/main/java/io/github/dsheirer/edac/Hamming15.java index 00183d40..22c1e6e2 100644 --- a/src/edac/Hamming15.java +++ b/src/main/java/io/github/dsheirer/edac/Hamming15.java @@ -1,6 +1,6 @@ -package edac; +package io.github.dsheirer.edac; -import bits.BinaryMessage; +import io.github.dsheirer.bits.BinaryMessage; public class Hamming15 { diff --git a/src/edac/ReedSolomon_63_47_17.java b/src/main/java/io/github/dsheirer/edac/ReedSolomon_63_47_17.java similarity index 97% rename from src/edac/ReedSolomon_63_47_17.java rename to src/main/java/io/github/dsheirer/edac/ReedSolomon_63_47_17.java index 55d62211..83bb510e 100644 --- a/src/edac/ReedSolomon_63_47_17.java +++ b/src/main/java/io/github/dsheirer/edac/ReedSolomon_63_47_17.java @@ -1,4 +1,4 @@ -package edac; +package io.github.dsheirer.edac; /******************************************************************************* * SDR Trunk diff --git a/src/edac/trellis/DMRNode.java b/src/main/java/io/github/dsheirer/edac/trellis/DMRNode.java similarity index 98% rename from src/edac/trellis/DMRNode.java rename to src/main/java/io/github/dsheirer/edac/trellis/DMRNode.java index 4124bd83..bd4255e2 100644 --- a/src/edac/trellis/DMRNode.java +++ b/src/main/java/io/github/dsheirer/edac/trellis/DMRNode.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package edac.trellis; +package io.github.dsheirer.edac.trellis; public class DMRNode extends Node { diff --git a/src/edac/trellis/Node.java b/src/main/java/io/github/dsheirer/edac/trellis/Node.java similarity index 98% rename from src/edac/trellis/Node.java rename to src/main/java/io/github/dsheirer/edac/trellis/Node.java index 3e54ebf0..e1506f5e 100644 --- a/src/edac/trellis/Node.java +++ b/src/main/java/io/github/dsheirer/edac/trellis/Node.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package edac.trellis; +package io.github.dsheirer.edac.trellis; public abstract class Node { diff --git a/src/edac/trellis/Path.java b/src/main/java/io/github/dsheirer/edac/trellis/Path.java similarity index 98% rename from src/edac/trellis/Path.java rename to src/main/java/io/github/dsheirer/edac/trellis/Path.java index 667bc7eb..e4b7eb7e 100644 --- a/src/edac/trellis/Path.java +++ b/src/main/java/io/github/dsheirer/edac/trellis/Path.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package edac.trellis; +package io.github.dsheirer.edac.trellis; import java.util.ArrayList; import java.util.List; diff --git a/src/edac/trellis/ViterbiDecoder.java b/src/main/java/io/github/dsheirer/edac/trellis/ViterbiDecoder.java similarity index 99% rename from src/edac/trellis/ViterbiDecoder.java rename to src/main/java/io/github/dsheirer/edac/trellis/ViterbiDecoder.java index 6341f1a6..48c7bc86 100644 --- a/src/edac/trellis/ViterbiDecoder.java +++ b/src/main/java/io/github/dsheirer/edac/trellis/ViterbiDecoder.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package edac.trellis; +package io.github.dsheirer.edac.trellis; import java.util.ArrayList; import java.util.Collection; diff --git a/src/edac/trellis/ViterbiDecoder_3_4_DMR.java b/src/main/java/io/github/dsheirer/edac/trellis/ViterbiDecoder_3_4_DMR.java similarity index 97% rename from src/edac/trellis/ViterbiDecoder_3_4_DMR.java rename to src/main/java/io/github/dsheirer/edac/trellis/ViterbiDecoder_3_4_DMR.java index 142c7ada..e4586cfb 100644 --- a/src/edac/trellis/ViterbiDecoder_3_4_DMR.java +++ b/src/main/java/io/github/dsheirer/edac/trellis/ViterbiDecoder_3_4_DMR.java @@ -16,10 +16,10 @@ * along with this program. If not, see * ******************************************************************************/ -package edac.trellis; +package io.github.dsheirer.edac.trellis; -import bits.BinaryMessage; -import bits.CorrectedBinaryMessage; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.bits.CorrectedBinaryMessage; import java.util.List; diff --git a/src/filter/AllPassFilter.java b/src/main/java/io/github/dsheirer/filter/AllPassFilter.java similarity index 94% rename from src/filter/AllPassFilter.java rename to src/main/java/io/github/dsheirer/filter/AllPassFilter.java index 89ccf6f4..945c5828 100644 --- a/src/filter/AllPassFilter.java +++ b/src/main/java/io/github/dsheirer/filter/AllPassFilter.java @@ -1,4 +1,4 @@ -package filter; +package io.github.dsheirer.filter; import java.util.Collections; import java.util.List; diff --git a/src/filter/Filter.java b/src/main/java/io/github/dsheirer/filter/Filter.java similarity index 90% rename from src/filter/Filter.java rename to src/main/java/io/github/dsheirer/filter/Filter.java index 173b0c50..9e84bd54 100644 --- a/src/filter/Filter.java +++ b/src/main/java/io/github/dsheirer/filter/Filter.java @@ -1,4 +1,4 @@ -package filter; +package io.github.dsheirer.filter; import java.util.List; @@ -13,7 +13,7 @@ public abstract class Filter implements IFilter } /** - * Indicates if this filter is enabled or disabled + * Indicates if this filter is enabled or disabled */ public boolean isEnabled() { diff --git a/src/filter/FilterEditorPanel.java b/src/main/java/io/github/dsheirer/filter/FilterEditorPanel.java similarity index 97% rename from src/filter/FilterEditorPanel.java rename to src/main/java/io/github/dsheirer/filter/FilterEditorPanel.java index 4273632d..49ebdc38 100644 --- a/src/filter/FilterEditorPanel.java +++ b/src/main/java/io/github/dsheirer/filter/FilterEditorPanel.java @@ -1,6 +1,15 @@ -package filter; +package io.github.dsheirer.filter; -import java.awt.Component; +import net.miginfocom.swing.MigLayout; + +import javax.swing.*; +import javax.swing.event.CellEditorListener; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.DefaultTreeCellRenderer; +import javax.swing.tree.DefaultTreeModel; +import javax.swing.tree.TreeCellEditor; +import javax.swing.tree.TreeSelectionModel; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; @@ -13,22 +22,6 @@ import java.util.Enumeration; import java.util.EventObject; import java.util.List; -import javax.swing.JCheckBox; -import javax.swing.JLabel; -import javax.swing.JMenuItem; -import javax.swing.JPanel; -import javax.swing.JPopupMenu; -import javax.swing.JTree; -import javax.swing.SwingUtilities; -import javax.swing.event.CellEditorListener; -import javax.swing.tree.DefaultMutableTreeNode; -import javax.swing.tree.DefaultTreeCellRenderer; -import javax.swing.tree.DefaultTreeModel; -import javax.swing.tree.TreeCellEditor; -import javax.swing.tree.TreeSelectionModel; - -import net.miginfocom.swing.MigLayout; - public class FilterEditorPanel extends JPanel { private static final long serialVersionUID = 1L; diff --git a/src/filter/FilterElement.java b/src/main/java/io/github/dsheirer/filter/FilterElement.java similarity index 95% rename from src/filter/FilterElement.java rename to src/main/java/io/github/dsheirer/filter/FilterElement.java index ce6bfa75..76668c4b 100644 --- a/src/filter/FilterElement.java +++ b/src/main/java/io/github/dsheirer/filter/FilterElement.java @@ -1,4 +1,4 @@ -package filter; +package io.github.dsheirer.filter; public class FilterElement implements Comparable> { diff --git a/src/filter/FilterSet.java b/src/main/java/io/github/dsheirer/filter/FilterSet.java similarity index 97% rename from src/filter/FilterSet.java rename to src/main/java/io/github/dsheirer/filter/FilterSet.java index 10823aea..6475778a 100644 --- a/src/filter/FilterSet.java +++ b/src/main/java/io/github/dsheirer/filter/FilterSet.java @@ -1,4 +1,4 @@ -package filter; +package io.github.dsheirer.filter; import java.util.ArrayList; import java.util.List; diff --git a/src/filter/IFilter.java b/src/main/java/io/github/dsheirer/filter/IFilter.java similarity index 95% rename from src/filter/IFilter.java rename to src/main/java/io/github/dsheirer/filter/IFilter.java index fbb7226f..b8596a29 100644 --- a/src/filter/IFilter.java +++ b/src/main/java/io/github/dsheirer/filter/IFilter.java @@ -1,4 +1,4 @@ -package filter; +package io.github.dsheirer.filter; public interface IFilter { diff --git a/src/gui/ChannelMemoryLogger.java b/src/main/java/io/github/dsheirer/gui/ChannelMemoryLogger.java similarity index 89% rename from src/gui/ChannelMemoryLogger.java rename to src/main/java/io/github/dsheirer/gui/ChannelMemoryLogger.java index 39b1085b..b36112d1 100644 --- a/src/gui/ChannelMemoryLogger.java +++ b/src/main/java/io/github/dsheirer/gui/ChannelMemoryLogger.java @@ -1,13 +1,12 @@ -package gui; - -import java.text.NumberFormat; +package io.github.dsheirer.gui; +import io.github.dsheirer.controller.channel.Channel.ChannelType; +import io.github.dsheirer.controller.channel.ChannelEvent; +import io.github.dsheirer.controller.channel.ChannelEventListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import controller.channel.Channel.ChannelType; -import controller.channel.ChannelEvent; -import controller.channel.ChannelEventListener; +import java.text.NumberFormat; public class ChannelMemoryLogger implements Runnable, ChannelEventListener { diff --git a/src/gui/SDRTrunk.java b/src/main/java/io/github/dsheirer/gui/SDRTrunk.java similarity index 91% rename from src/gui/SDRTrunk.java rename to src/main/java/io/github/dsheirer/gui/SDRTrunk.java index 9f3b4e06..79cedda4 100644 --- a/src/gui/SDRTrunk.java +++ b/src/main/java/io/github/dsheirer/gui/SDRTrunk.java @@ -16,39 +16,39 @@ * along with this program. If not, see * ******************************************************************************/ -package gui; +package io.github.dsheirer.gui; -import alias.AliasModel; -import alias.action.AliasActionManager; -import audio.AudioManager; -import audio.broadcast.BroadcastModel; -import audio.broadcast.BroadcastStatusPanel; import com.jidesoft.swing.JideSplitPane; -import controller.ControllerPanel; -import controller.channel.ChannelModel; -import controller.channel.ChannelProcessingManager; -import controller.channel.ChannelSelectionManager; -import controller.channel.map.ChannelMapModel; -import icon.IconManager; -import map.MapService; -import module.log.EventLogManager; +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; +import io.github.dsheirer.controller.ControllerPanel; +import io.github.dsheirer.controller.channel.ChannelModel; +import io.github.dsheirer.controller.channel.ChannelProcessingManager; +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; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.settings.SettingsManager; +import io.github.dsheirer.source.SourceManager; +import io.github.dsheirer.source.tuner.TunerEvent; +import io.github.dsheirer.source.tuner.TunerModel; +import io.github.dsheirer.source.tuner.TunerSpectralDisplayManager; +import io.github.dsheirer.source.tuner.configuration.TunerConfigurationModel; +import io.github.dsheirer.spectrum.SpectralDisplayPanel; +import io.github.dsheirer.util.ThreadPool; +import io.github.dsheirer.util.TimeStamp; import net.miginfocom.swing.MigLayout; import org.apache.commons.io.FileUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import playlist.PlaylistManager; -import properties.SystemProperties; -import record.RecorderManager; -import sample.Listener; -import settings.SettingsManager; -import source.SourceManager; -import source.tuner.TunerEvent; -import source.tuner.TunerModel; -import source.tuner.TunerSpectralDisplayManager; -import source.tuner.configuration.TunerConfigurationModel; -import spectrum.SpectralDisplayPanel; -import util.ThreadPool; -import util.TimeStamp; import javax.imageio.ImageIO; import javax.swing.*; diff --git a/src/gui/control/ConstellationViewer.java b/src/main/java/io/github/dsheirer/gui/control/ConstellationViewer.java similarity index 93% rename from src/gui/control/ConstellationViewer.java rename to src/main/java/io/github/dsheirer/gui/control/ConstellationViewer.java index fe9b0d08..cf51c81a 100644 --- a/src/gui/control/ConstellationViewer.java +++ b/src/main/java/io/github/dsheirer/gui/control/ConstellationViewer.java @@ -1,25 +1,18 @@ -package gui.control; +package io.github.dsheirer.gui.control; -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Graphics2D; +import io.github.dsheirer.buffer.CircularBuffer; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.Complex; + +import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.*; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.geom.Ellipse2D; import java.util.List; -import javax.swing.JPanel; -import javax.swing.JPopupMenu; -import javax.swing.JSlider; -import javax.swing.SwingUtilities; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - -import sample.Listener; -import sample.complex.Complex; -import buffer.CircularBuffer; - public class ConstellationViewer extends JPanel implements Listener { private static final long serialVersionUID = 1L; @@ -116,7 +109,7 @@ public class ConstellationViewer extends JPanel implements Listener if( mCounter > ( mOffset + mSamplesPerSymbol ) ) { /** - * Multiply the current sample against the complex conjugate of the + * Multiply the current sample against the complex conjugate of the * previous sample to derive the phase delta between the two samples * * Negating the previous sample quadrature produces the conjugate diff --git a/src/gui/control/CurveFittedAreaChart.java b/src/main/java/io/github/dsheirer/gui/control/CurveFittedAreaChart.java similarity index 99% rename from src/gui/control/CurveFittedAreaChart.java rename to src/main/java/io/github/dsheirer/gui/control/CurveFittedAreaChart.java index 98ca9068..674842b8 100644 --- a/src/gui/control/CurveFittedAreaChart.java +++ b/src/main/java/io/github/dsheirer/gui/control/CurveFittedAreaChart.java @@ -1,4 +1,4 @@ -package gui.control; +package io.github.dsheirer.gui.control; import javafx.collections.ObservableList; import javafx.geometry.Point2D; diff --git a/src/gui/control/JFrequencyControl.java b/src/main/java/io/github/dsheirer/gui/control/JFrequencyControl.java similarity index 97% rename from src/gui/control/JFrequencyControl.java rename to src/main/java/io/github/dsheirer/gui/control/JFrequencyControl.java index ca2053aa..ee417149 100644 --- a/src/gui/control/JFrequencyControl.java +++ b/src/main/java/io/github/dsheirer/gui/control/JFrequencyControl.java @@ -15,14 +15,19 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package gui.control; +package io.github.dsheirer.gui.control; -import java.awt.Color; -import java.awt.Cursor; -import java.awt.Font; -import java.awt.Image; -import java.awt.Point; -import java.awt.Toolkit; +import io.github.dsheirer.source.InvalidFrequencyException; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent; +import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent.Event; +import io.github.dsheirer.source.tuner.frequency.IFrequencyChangeProcessor; +import net.miginfocom.swing.MigLayout; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.swing.*; +import java.awt.*; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.MouseEvent; @@ -35,19 +40,6 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; -import javax.swing.*; - -import net.miginfocom.swing.MigLayout; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import source.InvalidFrequencyException; -import source.SourceException; -import source.tuner.frequency.FrequencyChangeEvent; -import source.tuner.frequency.FrequencyChangeEvent.Event; -import source.tuner.frequency.IFrequencyChangeProcessor; - public class JFrequencyControl extends JPanel implements IFrequencyChangeProcessor { private static final long serialVersionUID = 1L; diff --git a/src/gui/editor/DocumentListenerEditor.java b/src/main/java/io/github/dsheirer/gui/editor/DocumentListenerEditor.java similarity index 92% rename from src/gui/editor/DocumentListenerEditor.java rename to src/main/java/io/github/dsheirer/gui/editor/DocumentListenerEditor.java index 2524de87..f5025e34 100644 --- a/src/gui/editor/DocumentListenerEditor.java +++ b/src/main/java/io/github/dsheirer/gui/editor/DocumentListenerEditor.java @@ -1,4 +1,4 @@ -package gui.editor; +package io.github.dsheirer.gui.editor; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; diff --git a/src/gui/editor/Editor.java b/src/main/java/io/github/dsheirer/gui/editor/Editor.java similarity index 99% rename from src/gui/editor/Editor.java rename to src/main/java/io/github/dsheirer/gui/editor/Editor.java index 305b3c59..f084239d 100644 --- a/src/gui/editor/Editor.java +++ b/src/main/java/io/github/dsheirer/gui/editor/Editor.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package gui.editor; +package io.github.dsheirer.gui.editor; import javax.swing.*; diff --git a/src/gui/editor/EditorValidationException.java b/src/main/java/io/github/dsheirer/gui/editor/EditorValidationException.java similarity index 90% rename from src/gui/editor/EditorValidationException.java rename to src/main/java/io/github/dsheirer/gui/editor/EditorValidationException.java index 00ccf251..9e2237c8 100644 --- a/src/gui/editor/EditorValidationException.java +++ b/src/main/java/io/github/dsheirer/gui/editor/EditorValidationException.java @@ -1,4 +1,4 @@ -package gui.editor; +package io.github.dsheirer.gui.editor; public class EditorValidationException extends Exception { diff --git a/src/gui/editor/EmptyEditor.java b/src/main/java/io/github/dsheirer/gui/editor/EmptyEditor.java similarity index 88% rename from src/gui/editor/EmptyEditor.java rename to src/main/java/io/github/dsheirer/gui/editor/EmptyEditor.java index 7b16ee35..c40eae05 100644 --- a/src/gui/editor/EmptyEditor.java +++ b/src/main/java/io/github/dsheirer/gui/editor/EmptyEditor.java @@ -1,9 +1,9 @@ -package gui.editor; - -import javax.swing.JLabel; +package io.github.dsheirer.gui.editor; import net.miginfocom.swing.MigLayout; +import javax.swing.*; + public class EmptyEditor extends Editor { private static final long serialVersionUID = 1L; diff --git a/src/gui/editor/EmptyValidatingEditor.java b/src/main/java/io/github/dsheirer/gui/editor/EmptyValidatingEditor.java similarity index 90% rename from src/gui/editor/EmptyValidatingEditor.java rename to src/main/java/io/github/dsheirer/gui/editor/EmptyValidatingEditor.java index cdcd438c..fd5008af 100644 --- a/src/gui/editor/EmptyValidatingEditor.java +++ b/src/main/java/io/github/dsheirer/gui/editor/EmptyValidatingEditor.java @@ -1,9 +1,9 @@ -package gui.editor; - -import javax.swing.JLabel; +package io.github.dsheirer.gui.editor; import net.miginfocom.swing.MigLayout; +import javax.swing.*; + public class EmptyValidatingEditor extends ValidatingEditor { private static final long serialVersionUID = 1L; diff --git a/src/gui/editor/ValidatingEditor.java b/src/main/java/io/github/dsheirer/gui/editor/ValidatingEditor.java similarity index 91% rename from src/gui/editor/ValidatingEditor.java rename to src/main/java/io/github/dsheirer/gui/editor/ValidatingEditor.java index 149a8c4f..5f4d357d 100644 --- a/src/gui/editor/ValidatingEditor.java +++ b/src/main/java/io/github/dsheirer/gui/editor/ValidatingEditor.java @@ -1,4 +1,4 @@ -package gui.editor; +package io.github.dsheirer.gui.editor; /** diff --git a/src/icon/Icon.java b/src/main/java/io/github/dsheirer/icon/Icon.java similarity index 83% rename from src/icon/Icon.java rename to src/main/java/io/github/dsheirer/icon/Icon.java index 5d133a25..6c3024a9 100644 --- a/src/icon/Icon.java +++ b/src/main/java/io/github/dsheirer/icon/Icon.java @@ -16,17 +16,17 @@ * along with this program. If not, see * ******************************************************************************/ -package icon; +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 { private final static Logger mLog = LoggerFactory.getLogger(Icon.class); @@ -46,7 +46,7 @@ public class Icon implements Comparable mPath = path; } - @XmlAttribute(name = "name") + @JacksonXmlProperty(isAttribute = true, localName = "name") public String getName() { return mName; @@ -62,7 +62,7 @@ public class Icon implements Comparable return mName; } - @XmlAttribute(name = "path") + @JacksonXmlProperty(isAttribute = true, localName = "path") public String getPath() { return mPath; @@ -73,7 +73,7 @@ public class Icon implements Comparable mPath = path; } - @XmlTransient + @JsonIgnore public ImageIcon getIcon() { if(mImageIcon == null && mPath != null) diff --git a/src/icon/IconEditor.java b/src/main/java/io/github/dsheirer/icon/IconEditor.java similarity index 95% rename from src/icon/IconEditor.java rename to src/main/java/io/github/dsheirer/icon/IconEditor.java index e5fff02c..f1380bea 100644 --- a/src/icon/IconEditor.java +++ b/src/main/java/io/github/dsheirer/icon/IconEditor.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package icon; +package io.github.dsheirer.icon; import net.miginfocom.swing.MigLayout; import org.slf4j.Logger; @@ -25,7 +25,6 @@ import org.slf4j.LoggerFactory; import javax.swing.*; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; -import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -98,13 +97,13 @@ public class IconEditor extends JFrame implements ActionListener private void checkButtons() { - Icon selected = getSelectedIcon(); + io.github.dsheirer.icon.Icon selected = getSelectedIcon(); mDefaultButton.setEnabled(selected != null && selected != mIconManager.getModel().getDefaultIcon()); mDeleteButton.setEnabled(selected != null && selected != mIconManager.getModel().getDefaultIcon()); } - private Icon getSelectedIcon() + private io.github.dsheirer.icon.Icon getSelectedIcon() { int selectedViewRow = mIconTable.getSelectedRow(); @@ -123,7 +122,7 @@ public class IconEditor extends JFrame implements ActionListener public void actionPerformed(ActionEvent e) { - Icon selected = getSelectedIcon(); + io.github.dsheirer.icon.Icon selected = getSelectedIcon(); switch(e.getActionCommand()) { diff --git a/src/icon/IconListCellRenderer.java b/src/main/java/io/github/dsheirer/icon/IconListCellRenderer.java similarity index 92% rename from src/icon/IconListCellRenderer.java rename to src/main/java/io/github/dsheirer/icon/IconListCellRenderer.java index eb62683f..cf7feb0e 100644 --- a/src/icon/IconListCellRenderer.java +++ b/src/main/java/io/github/dsheirer/icon/IconListCellRenderer.java @@ -16,12 +16,12 @@ * along with this program. If not, see * ******************************************************************************/ -package icon; +package io.github.dsheirer.icon; import javax.swing.*; import java.awt.*; -public class IconListCellRenderer extends JLabel implements ListCellRenderer +public class IconListCellRenderer extends JLabel implements ListCellRenderer { private static final long serialVersionUID = 1L; @@ -34,7 +34,7 @@ public class IconListCellRenderer extends JLabel implements ListCellRenderer list, Icon icon, int index, + public Component getListCellRendererComponent(JList list, io.github.dsheirer.icon.Icon icon, int index, boolean isSelected, boolean cellHasFocus) { //Get a scaled version of the icon diff --git a/src/icon/IconManager.java b/src/main/java/io/github/dsheirer/icon/IconManager.java similarity index 75% rename from src/icon/IconManager.java rename to src/main/java/io/github/dsheirer/icon/IconManager.java index ea29ee56..a5f302df 100644 --- a/src/icon/IconManager.java +++ b/src/main/java/io/github/dsheirer/icon/IconManager.java @@ -1,35 +1,33 @@ -/******************************************************************************* +/* + * ********************************************************************************************************************* * 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 - * - ******************************************************************************/ -package icon; + * You should have received a copy of the GNU General Public License along with this program. + * If not, see + * ********************************************************************************************************************* + */ +package io.github.dsheirer.icon; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.dataformat.xml.JacksonXmlModule; +import com.fasterxml.jackson.dataformat.xml.XmlMapper; +import io.github.dsheirer.properties.SystemProperties; +import io.github.dsheirer.util.ThreadPool; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import properties.SystemProperties; -import util.ThreadPool; import javax.swing.*; import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Marshaller; -import javax.xml.bind.Unmarshaller; import java.awt.*; import java.io.IOException; import java.io.InputStream; @@ -129,7 +127,7 @@ public class IconManager /** * All icons in a sorted array */ - public Icon[] getIcons() + public io.github.dsheirer.icon.Icon[] getIcons() { return getModel().getIconsAsArray(); } @@ -156,7 +154,7 @@ public class IconManager return mResizedIcons.get(scaledIconName); } - Icon icon = getModel().getIcon(name); + io.github.dsheirer.icon.Icon icon = getModel().getIcon(name); ImageIcon scaledIcon = getScaledIcon(icon.getIcon(), height); mResizedIcons.put(scaledIconName, scaledIcon); @@ -245,8 +243,6 @@ public class IconManager { IconSet iconSet = getModel().getIconSet(); - JAXBContext context = null; - //Create a backup copy of the current playlist if(Files.exists(getIconFilePath())) { @@ -277,14 +273,11 @@ public class IconManager try(OutputStream out = Files.newOutputStream(getIconFilePath())) { - context = JAXBContext.newInstance(IconSet.class); - - Marshaller m = context.createMarshaller(); - - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); - - m.marshal(iconSet, out); - + JacksonXmlModule xmlModule = new JacksonXmlModule(); + xmlModule.setDefaultUseWrapper(false); + ObjectMapper objectMapper = new XmlMapper(xmlModule); + objectMapper.enable(SerializationFeature.INDENT_OUTPUT); + objectMapper.writeValue(out, iconSet); out.flush(); //Remove the playlist lock file to indicate that we successfully saved the file @@ -293,10 +286,6 @@ public class IconManager Files.delete(getIconLockFilePath()); } } - catch(JAXBException je) - { - mLog.error("JAXB exception while serializing icons to a file [" + getIconFilePath().toString() + "]", je); - } catch(IOException ioe) { mLog.error("IO error while writing icons to a file [" + getIconFilePath().toString() + "]", ioe); @@ -342,19 +331,13 @@ public class IconManager if(Files.exists(getIconFilePath())) { - JAXBContext context = null; + JacksonXmlModule xmlModule = new JacksonXmlModule(); + xmlModule.setDefaultUseWrapper(false); + ObjectMapper objectMapper = new XmlMapper(xmlModule); try(InputStream in = Files.newInputStream(getIconFilePath())) { - context = JAXBContext.newInstance(IconSet.class); - - Unmarshaller m = context.createUnmarshaller(); - - iconSet = (IconSet) m.unmarshal(in); - } - catch(JAXBException je) - { - mLog.error("JAXB exception while loading/unmarshalling icons", je); + iconSet = objectMapper.readValue(in, IconSet.class); } catch(IOException ioe) { @@ -376,26 +359,26 @@ public class IconManager { IconSet iconSet = new IconSet(); - Icon defaultIcon = new Icon(IconTableModel.DEFAULT_ICON, "images/no_icon.png"); + io.github.dsheirer.icon.Icon defaultIcon = new io.github.dsheirer.icon.Icon(IconTableModel.DEFAULT_ICON, "images/no_icon.png"); iconSet.add(defaultIcon); iconSet.setDefaultIcon(defaultIcon.getName()); - iconSet.add(new Icon("Ambulance", "images/ambulance.png")); - iconSet.add(new Icon("Block Truck", "images/concrete_block_truck.png")); - iconSet.add(new Icon("CWID", "images/cwid.png")); - iconSet.add(new Icon("Dispatcher", "images/dispatcher.png")); - iconSet.add(new Icon("Dump Truck", "images/dump_truck_red.png")); - iconSet.add(new Icon("Fire Truck", "images/fire_truck.png")); - iconSet.add(new Icon("Garbage Truck", "images/garbage_truck.png")); - iconSet.add(new Icon("Loader", "images/loader.png")); - iconSet.add(new Icon("Police", "images/police.png")); - iconSet.add(new Icon("Propane Truck", "images/propane_truck.png")); - iconSet.add(new Icon("Rescue Truck", "images/rescue_truck.png")); - iconSet.add(new Icon("School Bus", "images/school_bus.png")); - iconSet.add(new Icon("Taxi", "images/taxi.png")); - iconSet.add(new Icon("Train", "images/train.png")); - iconSet.add(new Icon("Transport Bus", "images/opt_bus.png")); - iconSet.add(new Icon("Van", "images/van.png")); + iconSet.add(new io.github.dsheirer.icon.Icon("Ambulance", "images/ambulance.png")); + iconSet.add(new io.github.dsheirer.icon.Icon("Block Truck", "images/concrete_block_truck.png")); + iconSet.add(new io.github.dsheirer.icon.Icon("CWID", "images/cwid.png")); + iconSet.add(new io.github.dsheirer.icon.Icon("Dispatcher", "images/dispatcher.png")); + iconSet.add(new io.github.dsheirer.icon.Icon("Dump Truck", "images/dump_truck_red.png")); + iconSet.add(new io.github.dsheirer.icon.Icon("Fire Truck", "images/fire_truck.png")); + iconSet.add(new io.github.dsheirer.icon.Icon("Garbage Truck", "images/garbage_truck.png")); + iconSet.add(new io.github.dsheirer.icon.Icon("Loader", "images/loader.png")); + iconSet.add(new io.github.dsheirer.icon.Icon("Police", "images/police.png")); + iconSet.add(new io.github.dsheirer.icon.Icon("Propane Truck", "images/propane_truck.png")); + iconSet.add(new io.github.dsheirer.icon.Icon("Rescue Truck", "images/rescue_truck.png")); + iconSet.add(new io.github.dsheirer.icon.Icon("School Bus", "images/school_bus.png")); + iconSet.add(new io.github.dsheirer.icon.Icon("Taxi", "images/taxi.png")); + iconSet.add(new io.github.dsheirer.icon.Icon("Train", "images/train.png")); + iconSet.add(new io.github.dsheirer.icon.Icon("Transport Bus", "images/opt_bus.png")); + iconSet.add(new io.github.dsheirer.icon.Icon("Van", "images/van.png")); return iconSet; } diff --git a/src/icon/IconSelector.java b/src/main/java/io/github/dsheirer/icon/IconSelector.java similarity index 97% rename from src/icon/IconSelector.java rename to src/main/java/io/github/dsheirer/icon/IconSelector.java index ced888df..b739d2b2 100644 --- a/src/icon/IconSelector.java +++ b/src/main/java/io/github/dsheirer/icon/IconSelector.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package icon; +package io.github.dsheirer.icon; import net.miginfocom.swing.MigLayout; @@ -119,7 +119,7 @@ public class IconSelector extends JDialog implements DocumentListener String name = mNameText.getText(); String path = mFileLabel.getText(); - Icon icon = new Icon(name, path); + io.github.dsheirer.icon.Icon icon = new io.github.dsheirer.icon.Icon(name, path); mIconTableModel.add(icon); IconSelector.this.dispose(); diff --git a/src/icon/IconSet.java b/src/main/java/io/github/dsheirer/icon/IconSet.java similarity index 81% rename from src/icon/IconSet.java rename to src/main/java/io/github/dsheirer/icon/IconSet.java index b1093bd1..86e61434 100644 --- a/src/icon/IconSet.java +++ b/src/main/java/io/github/dsheirer/icon/IconSet.java @@ -16,15 +16,15 @@ * along with this program. If not, see * ******************************************************************************/ -package icon; +package io.github.dsheirer.icon; + +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; 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 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; diff --git a/src/icon/IconTableCellRenderer.java b/src/main/java/io/github/dsheirer/icon/IconTableCellRenderer.java similarity index 98% rename from src/icon/IconTableCellRenderer.java rename to src/main/java/io/github/dsheirer/icon/IconTableCellRenderer.java index f58758b1..57cf4a43 100644 --- a/src/icon/IconTableCellRenderer.java +++ b/src/main/java/io/github/dsheirer/icon/IconTableCellRenderer.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package icon; +package io.github.dsheirer.icon; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/icon/IconTableModel.java b/src/main/java/io/github/dsheirer/icon/IconTableModel.java similarity index 80% rename from src/icon/IconTableModel.java rename to src/main/java/io/github/dsheirer/icon/IconTableModel.java index 7b1d72c8..ba98bd00 100644 --- a/src/icon/IconTableModel.java +++ b/src/main/java/io/github/dsheirer/icon/IconTableModel.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package icon; +package io.github.dsheirer.icon; import javax.swing.*; import javax.swing.table.AbstractTableModel; @@ -32,10 +32,10 @@ public class IconTableModel extends AbstractTableModel public static final int COLUMN_IMAGE_ICON = 0; public static final int COLUMN_ICON_NAME = 1; - private Icon mDefaultIcon; + private io.github.dsheirer.icon.Icon mDefaultIcon; - private Map mIconMap = new HashMap<>(); - private List mIcons = new ArrayList<>(); + private Map mIconMap = new HashMap<>(); + private List mIcons = new ArrayList<>(); public IconTableModel() { @@ -49,7 +49,7 @@ public class IconTableModel extends AbstractTableModel fireTableDataChanged(); - for(Icon icon: iconSet.getIcons()) + for(io.github.dsheirer.icon.Icon icon: iconSet.getIcons()) { add(icon); } @@ -60,7 +60,7 @@ public class IconTableModel extends AbstractTableModel /** * Adds the icon to the model */ - public void add(Icon icon) + public void add(io.github.dsheirer.icon.Icon icon) { if(icon != null) { @@ -75,7 +75,7 @@ public class IconTableModel extends AbstractTableModel /** * Removes the icon from the model */ - public void remove(Icon icon) + public void remove(io.github.dsheirer.icon.Icon icon) { if(icon != null && mIcons.contains(icon)) { @@ -89,7 +89,7 @@ public class IconTableModel extends AbstractTableModel } - public Icon get(int row) + public io.github.dsheirer.icon.Icon get(int row) { if(row < mIcons.size()) { @@ -116,7 +116,7 @@ public class IconTableModel extends AbstractTableModel { if(rowIndex < mIcons.size() && columnIndex < getColumnCount()) { - Icon icon = get(rowIndex); + io.github.dsheirer.icon.Icon icon = get(rowIndex); switch(columnIndex) { @@ -162,19 +162,19 @@ public class IconTableModel extends AbstractTableModel /** * Icons in an array - suitable for use in a JComboBox */ - public Icon[] getIconsAsArray() + public io.github.dsheirer.icon.Icon[] getIconsAsArray() { - List icons = new ArrayList<>(mIconMap.values()); + List icons = new ArrayList<>(mIconMap.values()); Collections.sort(icons); - return icons.toArray(new Icon[icons.size()]); + return icons.toArray(new io.github.dsheirer.icon.Icon[icons.size()]); } /** * Returns the current default icon */ - public Icon getDefaultIcon() + public io.github.dsheirer.icon.Icon getDefaultIcon() { return mDefaultIcon; } @@ -182,7 +182,7 @@ public class IconTableModel extends AbstractTableModel /** * Indicates if the icon argument is the current default icon */ - public boolean isDefaultIcon(Icon icon) + public boolean isDefaultIcon(io.github.dsheirer.icon.Icon icon) { return icon == getDefaultIcon(); } @@ -198,7 +198,7 @@ public class IconTableModel extends AbstractTableModel return name != null && !name.isEmpty() && mIconMap.containsKey(name); } - public void setDefaultIcon(Icon icon) + public void setDefaultIcon(io.github.dsheirer.icon.Icon icon) { if(icon != null) { @@ -223,7 +223,7 @@ public class IconTableModel extends AbstractTableModel name = DEFAULT_ICON; } - Icon defaultIcon = mIconMap.get(name); + io.github.dsheirer.icon.Icon defaultIcon = mIconMap.get(name); if(defaultIcon != null) { @@ -231,7 +231,7 @@ public class IconTableModel extends AbstractTableModel } else { - defaultIcon = new Icon(DEFAULT_ICON, "images/no_icon.png"); + defaultIcon = new io.github.dsheirer.icon.Icon(DEFAULT_ICON, "images/no_icon.png"); add(defaultIcon); setDefaultIcon(defaultIcon); } @@ -240,14 +240,14 @@ public class IconTableModel extends AbstractTableModel /** * Returns the named icon or the default icon if the named icon does not exist */ - public Icon getIcon(String name) + public io.github.dsheirer.icon.Icon getIcon(String name) { if(name == null || name.isEmpty()) { return mDefaultIcon; } - Icon icon = mIconMap.get(name); + io.github.dsheirer.icon.Icon icon = mIconMap.get(name); if(icon == null) { @@ -263,7 +263,7 @@ public class IconTableModel extends AbstractTableModel public IconSet getIconSet() { IconSet iconSet = new IconSet(); - iconSet.setIcons(new ArrayList(mIconMap.values())); + iconSet.setIcons(new ArrayList(mIconMap.values())); iconSet.setDefaultIcon(getDefaultIcon().getName()); return iconSet; } diff --git a/src/icon/ImageFilter.java b/src/main/java/io/github/dsheirer/icon/ImageFilter.java similarity index 98% rename from src/icon/ImageFilter.java rename to src/main/java/io/github/dsheirer/icon/ImageFilter.java index 2fea9ab8..867026f1 100644 --- a/src/icon/ImageFilter.java +++ b/src/main/java/io/github/dsheirer/icon/ImageFilter.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package icon; +package io.github.dsheirer.icon; import javax.swing.filechooser.FileFilter; import java.io.File; diff --git a/src/instrument/Instrumentable.java b/src/main/java/io/github/dsheirer/instrument/Instrumentable.java similarity index 92% rename from src/instrument/Instrumentable.java rename to src/main/java/io/github/dsheirer/instrument/Instrumentable.java index f6b743ea..c06db9ab 100644 --- a/src/instrument/Instrumentable.java +++ b/src/main/java/io/github/dsheirer/instrument/Instrumentable.java @@ -15,10 +15,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument; +package io.github.dsheirer.instrument; -import instrument.tap.Tap; -import instrument.tap.TapGroup; +import io.github.dsheirer.instrument.tap.Tap; +import io.github.dsheirer.instrument.tap.TapGroup; import java.util.List; diff --git a/src/instrument/InstrumentableProcessingChain.java b/src/main/java/io/github/dsheirer/instrument/InstrumentableProcessingChain.java similarity index 86% rename from src/instrument/InstrumentableProcessingChain.java rename to src/main/java/io/github/dsheirer/instrument/InstrumentableProcessingChain.java index 0ca61c90..d2a99b2f 100644 --- a/src/instrument/InstrumentableProcessingChain.java +++ b/src/main/java/io/github/dsheirer/instrument/InstrumentableProcessingChain.java @@ -16,14 +16,14 @@ * along with this program. If not, see * ******************************************************************************/ -package instrument; +package io.github.dsheirer.instrument; -import controller.channel.Channel.ChannelType; -import instrument.tap.Tap; -import instrument.tap.TapGroup; -import module.Module; -import module.ProcessingChain; -import source.Source; +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.module.Module; +import io.github.dsheirer.module.ProcessingChain; +import io.github.dsheirer.source.Source; import java.util.ArrayList; import java.util.List; diff --git a/src/instrument/gui/ConstellationPanel.java b/src/main/java/io/github/dsheirer/instrument/gui/ConstellationPanel.java similarity index 86% rename from src/instrument/gui/ConstellationPanel.java rename to src/main/java/io/github/dsheirer/instrument/gui/ConstellationPanel.java index b6cfd14b..77682fa5 100644 --- a/src/instrument/gui/ConstellationPanel.java +++ b/src/main/java/io/github/dsheirer/instrument/gui/ConstellationPanel.java @@ -15,18 +15,16 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.gui; - -import gui.control.ConstellationViewer; - -import java.awt.Dimension; - -import javax.swing.JInternalFrame; +package io.github.dsheirer.instrument.gui; +import io.github.dsheirer.gui.control.ConstellationViewer; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.Complex; +import io.github.dsheirer.source.IFrameLocationListener; import net.miginfocom.swing.MigLayout; -import sample.Listener; -import sample.complex.Complex; -import source.IFrameLocationListener; + +import javax.swing.*; +import java.awt.*; public class ConstellationPanel extends JInternalFrame implements IFrameLocationListener, Listener diff --git a/src/instrument/gui/DecoderSelectionFrame.java b/src/main/java/io/github/dsheirer/instrument/gui/DecoderSelectionFrame.java similarity index 83% rename from src/instrument/gui/DecoderSelectionFrame.java rename to src/main/java/io/github/dsheirer/instrument/gui/DecoderSelectionFrame.java index c79ad61c..00df6945 100644 --- a/src/instrument/gui/DecoderSelectionFrame.java +++ b/src/main/java/io/github/dsheirer/instrument/gui/DecoderSelectionFrame.java @@ -1,13 +1,13 @@ -package instrument.gui; +package io.github.dsheirer.instrument.gui; -import alias.AliasModel; -import audio.broadcast.BroadcastModel; -import controller.channel.ChannelModel; -import controller.channel.map.ChannelMapModel; -import module.decode.DecodeConfigurationEditor; +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 playlist.PlaylistManager; -import source.IControllableFileSource; import javax.swing.*; import java.awt.*; diff --git a/src/instrument/gui/DecoderViewFrame.java b/src/main/java/io/github/dsheirer/instrument/gui/DecoderViewFrame.java similarity index 81% rename from src/instrument/gui/DecoderViewFrame.java rename to src/main/java/io/github/dsheirer/instrument/gui/DecoderViewFrame.java index ed9bba65..8c944c0c 100644 --- a/src/instrument/gui/DecoderViewFrame.java +++ b/src/main/java/io/github/dsheirer/instrument/gui/DecoderViewFrame.java @@ -16,46 +16,46 @@ * along with this program. If not, see * ******************************************************************************/ -package instrument.gui; +package io.github.dsheirer.instrument.gui; -import alias.AliasModel; -import controller.channel.Channel; -import controller.channel.ChannelModel; -import controller.channel.ChannelProcessingManager; -import controller.channel.map.ChannelMapModel; -import instrument.Instrumentable; -import instrument.InstrumentableProcessingChain; -import instrument.tap.Tap; -import instrument.tap.TapGroup; -import instrument.tap.TapViewPanel; -import instrument.tap.stream.BinaryTap; -import instrument.tap.stream.BinaryTapViewPanel; -import instrument.tap.stream.ComplexSampleTap; -import instrument.tap.stream.ComplexSampleTapViewPanel; -import instrument.tap.stream.ComplexTap; -import instrument.tap.stream.ComplexTapViewPanel; -import instrument.tap.stream.DibitTap; -import instrument.tap.stream.DibitTapViewPanel; -import instrument.tap.stream.EyeDiagramDataTap; -import instrument.tap.stream.EyeDiagramDataTapPanel; -import instrument.tap.stream.FloatTap; -import instrument.tap.stream.FloatTapViewPanel; -import instrument.tap.stream.QPSKTap; -import instrument.tap.stream.QPSKTapPanel; -import instrument.tap.stream.SymbolEventTap; -import instrument.tap.stream.SymbolEventTapViewPanel; -import message.Message; -import module.Module; -import module.decode.DecoderFactory; -import module.decode.config.DecodeConfiguration; -import module.log.EventLogManager; +import io.github.dsheirer.alias.AliasModel; +import io.github.dsheirer.controller.channel.Channel; +import io.github.dsheirer.controller.channel.ChannelModel; +import io.github.dsheirer.controller.channel.ChannelProcessingManager; +import io.github.dsheirer.controller.channel.map.ChannelMapModel; +import io.github.dsheirer.instrument.Instrumentable; +import io.github.dsheirer.instrument.InstrumentableProcessingChain; +import io.github.dsheirer.instrument.tap.Tap; +import io.github.dsheirer.instrument.tap.TapGroup; +import io.github.dsheirer.instrument.tap.TapViewPanel; +import io.github.dsheirer.instrument.tap.stream.BinaryTap; +import io.github.dsheirer.instrument.tap.stream.BinaryTapViewPanel; +import io.github.dsheirer.instrument.tap.stream.ComplexSampleTap; +import io.github.dsheirer.instrument.tap.stream.ComplexSampleTapViewPanel; +import io.github.dsheirer.instrument.tap.stream.ComplexTap; +import io.github.dsheirer.instrument.tap.stream.ComplexTapViewPanel; +import io.github.dsheirer.instrument.tap.stream.DibitTap; +import io.github.dsheirer.instrument.tap.stream.DibitTapViewPanel; +import io.github.dsheirer.instrument.tap.stream.EyeDiagramDataTap; +import io.github.dsheirer.instrument.tap.stream.EyeDiagramDataTapPanel; +import io.github.dsheirer.instrument.tap.stream.FloatTap; +import io.github.dsheirer.instrument.tap.stream.FloatTapViewPanel; +import io.github.dsheirer.instrument.tap.stream.QPSKTap; +import io.github.dsheirer.instrument.tap.stream.QPSKTapPanel; +import io.github.dsheirer.instrument.tap.stream.SymbolEventTap; +import io.github.dsheirer.instrument.tap.stream.SymbolEventTapViewPanel; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.module.Module; +import io.github.dsheirer.module.decode.DecoderFactory; +import io.github.dsheirer.module.decode.config.DecodeConfiguration; +import io.github.dsheirer.module.log.EventLogManager; +import io.github.dsheirer.playlist.PlaylistManager; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.source.IControllableFileSource; +import io.github.dsheirer.source.Source; import net.miginfocom.swing.MigLayout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import playlist.PlaylistManager; -import sample.Listener; -import source.IControllableFileSource; -import source.Source; import javax.swing.*; import java.awt.*; diff --git a/src/instrument/gui/SampleModel.java b/src/main/java/io/github/dsheirer/instrument/gui/SampleModel.java similarity index 95% rename from src/instrument/gui/SampleModel.java rename to src/main/java/io/github/dsheirer/instrument/gui/SampleModel.java index 69c3948c..0d7705ec 100644 --- a/src/instrument/gui/SampleModel.java +++ b/src/main/java/io/github/dsheirer/instrument/gui/SampleModel.java @@ -15,18 +15,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.gui; +package io.github.dsheirer.instrument.gui; -import instrument.tap.TapListener; +import io.github.dsheirer.instrument.tap.TapListener; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Observable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class SampleModel extends Observable implements TapListener { private final static Logger mLog = diff --git a/src/instrument/gui/SourceControllerFrame.java b/src/main/java/io/github/dsheirer/instrument/gui/SourceControllerFrame.java similarity index 93% rename from src/instrument/gui/SourceControllerFrame.java rename to src/main/java/io/github/dsheirer/instrument/gui/SourceControllerFrame.java index c2eca173..6b112e13 100644 --- a/src/instrument/gui/SourceControllerFrame.java +++ b/src/main/java/io/github/dsheirer/instrument/gui/SourceControllerFrame.java @@ -15,32 +15,22 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.gui; +package io.github.dsheirer.instrument.gui; -import java.awt.Dimension; -import java.awt.EventQueue; +import io.github.dsheirer.source.IControllableFileSource; +import io.github.dsheirer.source.IFrameLocationListener; +import net.miginfocom.swing.MigLayout; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.swing.*; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.io.IOException; -import javax.swing.JButton; -import javax.swing.JDesktopPane; -import javax.swing.JInternalFrame; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JTextField; - -import net.miginfocom.swing.MigLayout; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import source.IControllableFileSource; -import source.IFrameLocationListener; - public class SourceControllerFrame extends JInternalFrame implements IFrameLocationListener { diff --git a/src/instrument/gui/Viewer.java b/src/main/java/io/github/dsheirer/instrument/gui/Viewer.java similarity index 94% rename from src/instrument/gui/Viewer.java rename to src/main/java/io/github/dsheirer/instrument/gui/Viewer.java index 3ef30096..39748fe2 100644 --- a/src/instrument/gui/Viewer.java +++ b/src/main/java/io/github/dsheirer/instrument/gui/Viewer.java @@ -15,11 +15,20 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.gui; +package io.github.dsheirer.instrument.gui; -import java.awt.AWTException; -import java.awt.EventQueue; -import java.awt.Robot; +import io.github.dsheirer.properties.SystemProperties; +import io.github.dsheirer.source.IControllableFileSource; +import io.github.dsheirer.source.wave.ComplexWaveSource; +import io.github.dsheirer.source.wave.RealWaveSource; +import io.github.dsheirer.util.TimeStamp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.imageio.ImageIO; +import javax.swing.*; +import javax.swing.filechooser.FileFilter; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.image.BufferedImage; @@ -28,25 +37,6 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; -import javax.imageio.ImageIO; -import javax.swing.JDesktopPane; -import javax.swing.JFileChooser; -import javax.swing.JFrame; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JSeparator; -import javax.swing.filechooser.FileFilter; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import properties.SystemProperties; -import source.IControllableFileSource; -import source.wave.ComplexWaveSource; -import source.wave.RealWaveSource; -import util.TimeStamp; - public class Viewer { private final static Logger mLog = LoggerFactory.getLogger( Viewer.class ); diff --git a/src/instrument/tap/Tap.java b/src/main/java/io/github/dsheirer/instrument/tap/Tap.java similarity index 98% rename from src/instrument/tap/Tap.java rename to src/main/java/io/github/dsheirer/instrument/tap/Tap.java index c0d29c05..ff3cc97e 100644 --- a/src/instrument/tap/Tap.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/Tap.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.tap; +package io.github.dsheirer.instrument.tap; import java.util.ArrayList; diff --git a/src/instrument/tap/TapGroup.java b/src/main/java/io/github/dsheirer/instrument/tap/TapGroup.java similarity index 90% rename from src/instrument/tap/TapGroup.java rename to src/main/java/io/github/dsheirer/instrument/tap/TapGroup.java index 988c3181..7cb5deaf 100644 --- a/src/instrument/tap/TapGroup.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/TapGroup.java @@ -1,4 +1,4 @@ -package instrument.tap; +package io.github.dsheirer.instrument.tap; import java.util.ArrayList; import java.util.List; diff --git a/src/instrument/tap/TapListener.java b/src/main/java/io/github/dsheirer/instrument/tap/TapListener.java similarity index 95% rename from src/instrument/tap/TapListener.java rename to src/main/java/io/github/dsheirer/instrument/tap/TapListener.java index f6fdd25e..eda419a7 100644 --- a/src/instrument/tap/TapListener.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/TapListener.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.tap; +package io.github.dsheirer.instrument.tap; public interface TapListener { diff --git a/src/instrument/tap/TapType.java b/src/main/java/io/github/dsheirer/instrument/tap/TapType.java similarity index 96% rename from src/instrument/tap/TapType.java rename to src/main/java/io/github/dsheirer/instrument/tap/TapType.java index 0c3dd212..6013523f 100644 --- a/src/instrument/tap/TapType.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/TapType.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.tap; +package io.github.dsheirer.instrument.tap; public enum TapType { diff --git a/src/instrument/tap/TapViewPanel.java b/src/main/java/io/github/dsheirer/instrument/tap/TapViewPanel.java similarity index 93% rename from src/instrument/tap/TapViewPanel.java rename to src/main/java/io/github/dsheirer/instrument/tap/TapViewPanel.java index 4124c71f..2af797a0 100644 --- a/src/instrument/tap/TapViewPanel.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/TapViewPanel.java @@ -15,20 +15,16 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.tap; +package io.github.dsheirer.instrument.tap; -import instrument.gui.SampleModel; +import io.github.dsheirer.instrument.gui.SampleModel; -import java.awt.Color; -import java.awt.Dimension; +import javax.swing.*; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Observer; -import javax.swing.JCheckBoxMenuItem; -import javax.swing.JMenu; -import javax.swing.JPanel; - public abstract class TapViewPanel extends JPanel implements Observer { private static final long serialVersionUID = 1L; diff --git a/src/instrument/tap/event/SyncDetectTap.java b/src/main/java/io/github/dsheirer/instrument/tap/event/SyncDetectTap.java similarity index 81% rename from src/instrument/tap/event/SyncDetectTap.java rename to src/main/java/io/github/dsheirer/instrument/tap/event/SyncDetectTap.java index b6b123ed..c027b596 100644 --- a/src/instrument/tap/event/SyncDetectTap.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/event/SyncDetectTap.java @@ -15,22 +15,22 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.tap.event; +package io.github.dsheirer.instrument.tap.event; -import instrument.tap.Tap; -import instrument.tap.TapListener; -import instrument.tap.TapType; -import dsp.symbol.SyncDetectListener; -import dsp.symbol.SyncDetectProvider; +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; -public class SyncDetectTap extends Tap +public class SyncDetectTap extends Tap implements SyncDetectListener, SyncDetectProvider { private SyncDetectListener mListener; /** - * Sync detect event tap. Indicates when message sync word has been + * Sync detect event tap. Indicates when message sync word has been * detected within a binary stream of data. */ public SyncDetectTap() diff --git a/src/instrument/tap/stream/AdditiveFloatTap.java b/src/main/java/io/github/dsheirer/instrument/tap/stream/AdditiveFloatTap.java similarity index 96% rename from src/instrument/tap/stream/AdditiveFloatTap.java rename to src/main/java/io/github/dsheirer/instrument/tap/stream/AdditiveFloatTap.java index 31ff2d23..75d5582e 100644 --- a/src/instrument/tap/stream/AdditiveFloatTap.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/stream/AdditiveFloatTap.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.tap.stream; +package io.github.dsheirer.instrument.tap.stream; public class AdditiveFloatTap extends FloatTap diff --git a/src/instrument/tap/stream/BinaryTap.java b/src/main/java/io/github/dsheirer/instrument/tap/stream/BinaryTap.java similarity index 89% rename from src/instrument/tap/stream/BinaryTap.java rename to src/main/java/io/github/dsheirer/instrument/tap/stream/BinaryTap.java index 030fcf3d..9b82a7a2 100644 --- a/src/instrument/tap/stream/BinaryTap.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/stream/BinaryTap.java @@ -15,11 +15,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.tap.stream; +package io.github.dsheirer.instrument.tap.stream; -import instrument.tap.TapListener; -import instrument.tap.TapType; -import sample.Listener; +import io.github.dsheirer.instrument.tap.TapListener; +import io.github.dsheirer.instrument.tap.TapType; +import io.github.dsheirer.sample.Listener; public class BinaryTap extends StreamTap implements Listener diff --git a/src/instrument/tap/stream/BinaryTapViewPanel.java b/src/main/java/io/github/dsheirer/instrument/tap/stream/BinaryTapViewPanel.java similarity index 94% rename from src/instrument/tap/stream/BinaryTapViewPanel.java rename to src/main/java/io/github/dsheirer/instrument/tap/stream/BinaryTapViewPanel.java index 07b72667..3172dfe7 100644 --- a/src/instrument/tap/stream/BinaryTapViewPanel.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/stream/BinaryTapViewPanel.java @@ -15,16 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.tap.stream; +package io.github.dsheirer.instrument.tap.stream; -import instrument.gui.SampleModel; -import instrument.tap.Tap; -import instrument.tap.TapViewPanel; +import io.github.dsheirer.instrument.gui.SampleModel; +import io.github.dsheirer.instrument.tap.Tap; +import io.github.dsheirer.instrument.tap.TapViewPanel; -import java.awt.Color; -import java.awt.FontMetrics; -import java.awt.Graphics; -import java.awt.Graphics2D; +import java.awt.*; import java.awt.geom.Path2D; import java.awt.geom.Rectangle2D; import java.util.List; diff --git a/src/instrument/tap/stream/ComplexSampleTap.java b/src/main/java/io/github/dsheirer/instrument/tap/stream/ComplexSampleTap.java similarity index 87% rename from src/instrument/tap/stream/ComplexSampleTap.java rename to src/main/java/io/github/dsheirer/instrument/tap/stream/ComplexSampleTap.java index a13b0c33..28451918 100644 --- a/src/instrument/tap/stream/ComplexSampleTap.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/stream/ComplexSampleTap.java @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.tap.stream; +package io.github.dsheirer.instrument.tap.stream; -import instrument.tap.TapListener; -import instrument.tap.TapType; -import sample.complex.Complex; -import sample.complex.ComplexSampleListener; +import io.github.dsheirer.instrument.tap.TapListener; +import io.github.dsheirer.instrument.tap.TapType; +import io.github.dsheirer.sample.complex.Complex; +import io.github.dsheirer.sample.complex.ComplexSampleListener; public class ComplexSampleTap extends StreamTap implements ComplexSampleListener { diff --git a/src/instrument/tap/stream/ComplexSampleTapViewPanel.java b/src/main/java/io/github/dsheirer/instrument/tap/stream/ComplexSampleTapViewPanel.java similarity index 93% rename from src/instrument/tap/stream/ComplexSampleTapViewPanel.java rename to src/main/java/io/github/dsheirer/instrument/tap/stream/ComplexSampleTapViewPanel.java index 8c5713af..1ab7bac5 100644 --- a/src/instrument/tap/stream/ComplexSampleTapViewPanel.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/stream/ComplexSampleTapViewPanel.java @@ -15,27 +15,22 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.tap.stream; +package io.github.dsheirer.instrument.tap.stream; -import gui.SDRTrunk; -import instrument.gui.SampleModel; -import instrument.tap.Tap; -import instrument.tap.TapViewPanel; +import io.github.dsheirer.gui.SDRTrunk; +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.sample.complex.Complex; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Graphics2D; +import java.awt.*; import java.awt.geom.Path2D; import java.awt.geom.Point2D; import java.util.List; import java.util.Observable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import sample.complex.Complex; - public class ComplexSampleTapViewPanel extends TapViewPanel { private static final long serialVersionUID = 1L; diff --git a/src/instrument/tap/stream/ComplexTap.java b/src/main/java/io/github/dsheirer/instrument/tap/stream/ComplexTap.java similarity index 87% rename from src/instrument/tap/stream/ComplexTap.java rename to src/main/java/io/github/dsheirer/instrument/tap/stream/ComplexTap.java index 2d6cf9d2..34f798d3 100644 --- a/src/instrument/tap/stream/ComplexTap.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/stream/ComplexTap.java @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.tap.stream; +package io.github.dsheirer.instrument.tap.stream; -import instrument.tap.TapListener; -import instrument.tap.TapType; -import sample.Listener; -import sample.complex.Complex; +import io.github.dsheirer.instrument.tap.TapListener; +import io.github.dsheirer.instrument.tap.TapType; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.Complex; public class ComplexTap extends StreamTap implements Listener { diff --git a/src/instrument/tap/stream/ComplexTapViewPanel.java b/src/main/java/io/github/dsheirer/instrument/tap/stream/ComplexTapViewPanel.java similarity index 93% rename from src/instrument/tap/stream/ComplexTapViewPanel.java rename to src/main/java/io/github/dsheirer/instrument/tap/stream/ComplexTapViewPanel.java index a23b997c..bf10ed3c 100644 --- a/src/instrument/tap/stream/ComplexTapViewPanel.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/stream/ComplexTapViewPanel.java @@ -15,27 +15,22 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.tap.stream; +package io.github.dsheirer.instrument.tap.stream; -import gui.SDRTrunk; -import instrument.gui.SampleModel; -import instrument.tap.Tap; -import instrument.tap.TapViewPanel; +import io.github.dsheirer.gui.SDRTrunk; +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.sample.complex.Complex; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Graphics2D; +import java.awt.*; import java.awt.geom.Path2D; import java.awt.geom.Point2D; import java.util.List; import java.util.Observable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import sample.complex.Complex; - public class ComplexTapViewPanel extends TapViewPanel { private static final long serialVersionUID = 1L; diff --git a/src/instrument/tap/stream/DibitTap.java b/src/main/java/io/github/dsheirer/instrument/tap/stream/DibitTap.java similarity index 86% rename from src/instrument/tap/stream/DibitTap.java rename to src/main/java/io/github/dsheirer/instrument/tap/stream/DibitTap.java index 16069bce..dcd30186 100644 --- a/src/instrument/tap/stream/DibitTap.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/stream/DibitTap.java @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.tap.stream; +package io.github.dsheirer.instrument.tap.stream; -import instrument.tap.TapListener; -import instrument.tap.TapType; -import sample.Listener; -import dsp.symbol.Dibit; +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; public class DibitTap extends StreamTap implements Listener diff --git a/src/instrument/tap/stream/DibitTapViewPanel.java b/src/main/java/io/github/dsheirer/instrument/tap/stream/DibitTapViewPanel.java similarity index 94% rename from src/instrument/tap/stream/DibitTapViewPanel.java rename to src/main/java/io/github/dsheirer/instrument/tap/stream/DibitTapViewPanel.java index 4769cac8..7a53e622 100644 --- a/src/instrument/tap/stream/DibitTapViewPanel.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/stream/DibitTapViewPanel.java @@ -15,23 +15,19 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.tap.stream; +package io.github.dsheirer.instrument.tap.stream; -import instrument.gui.SampleModel; -import instrument.tap.Tap; -import instrument.tap.TapViewPanel; +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 java.awt.Color; -import java.awt.FontMetrics; -import java.awt.Graphics; -import java.awt.Graphics2D; +import java.awt.*; import java.awt.geom.Path2D; import java.awt.geom.Rectangle2D; import java.util.List; import java.util.Observable; -import dsp.symbol.Dibit; - public class DibitTapViewPanel extends TapViewPanel { private static final long serialVersionUID = 1L; diff --git a/src/instrument/tap/stream/EyeDiagramData.java b/src/main/java/io/github/dsheirer/instrument/tap/stream/EyeDiagramData.java similarity index 93% rename from src/instrument/tap/stream/EyeDiagramData.java rename to src/main/java/io/github/dsheirer/instrument/tap/stream/EyeDiagramData.java index 8cd2828b..3006c011 100644 --- a/src/instrument/tap/stream/EyeDiagramData.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/stream/EyeDiagramData.java @@ -1,4 +1,4 @@ -package instrument.tap.stream; +package io.github.dsheirer.instrument.tap.stream; public class EyeDiagramData diff --git a/src/instrument/tap/stream/EyeDiagramDataTap.java b/src/main/java/io/github/dsheirer/instrument/tap/stream/EyeDiagramDataTap.java similarity index 89% rename from src/instrument/tap/stream/EyeDiagramDataTap.java rename to src/main/java/io/github/dsheirer/instrument/tap/stream/EyeDiagramDataTap.java index 2424e9df..4278e469 100644 --- a/src/instrument/tap/stream/EyeDiagramDataTap.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/stream/EyeDiagramDataTap.java @@ -15,16 +15,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.tap.stream; - -import instrument.tap.TapListener; -import instrument.tap.TapType; +package io.github.dsheirer.instrument.tap.stream; +import io.github.dsheirer.instrument.tap.TapListener; +import io.github.dsheirer.instrument.tap.TapType; +import io.github.dsheirer.sample.Listener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; - public class EyeDiagramDataTap extends StreamTap implements Listener { private final static Logger mLog = LoggerFactory.getLogger( EyeDiagramDataTap.class ); diff --git a/src/instrument/tap/stream/EyeDiagramDataTapPanel.java b/src/main/java/io/github/dsheirer/instrument/tap/stream/EyeDiagramDataTapPanel.java similarity index 96% rename from src/instrument/tap/stream/EyeDiagramDataTapPanel.java rename to src/main/java/io/github/dsheirer/instrument/tap/stream/EyeDiagramDataTapPanel.java index c715c7b1..530da620 100644 --- a/src/instrument/tap/stream/EyeDiagramDataTapPanel.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/stream/EyeDiagramDataTapPanel.java @@ -15,24 +15,20 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.tap.stream; +package io.github.dsheirer.instrument.tap.stream; -import instrument.gui.SampleModel; -import instrument.tap.TapViewPanel; +import io.github.dsheirer.instrument.gui.SampleModel; +import io.github.dsheirer.instrument.tap.TapViewPanel; +import io.github.dsheirer.sample.complex.Complex; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; -import java.awt.Color; -import java.awt.Graphics; -import java.awt.Graphics2D; +import java.awt.*; import java.awt.geom.GeneralPath; import java.awt.geom.Path2D; import java.util.List; import java.util.Observable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import sample.complex.Complex; - public class EyeDiagramDataTapPanel extends TapViewPanel { private static final long serialVersionUID = 1L; diff --git a/src/instrument/tap/stream/FloatBufferTap.java b/src/main/java/io/github/dsheirer/instrument/tap/stream/FloatBufferTap.java similarity index 85% rename from src/instrument/tap/stream/FloatBufferTap.java rename to src/main/java/io/github/dsheirer/instrument/tap/stream/FloatBufferTap.java index 6f658216..8e038c5a 100644 --- a/src/instrument/tap/stream/FloatBufferTap.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/stream/FloatBufferTap.java @@ -1,11 +1,10 @@ -package instrument.tap.stream; +package io.github.dsheirer.instrument.tap.stream; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.RealBuffer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; -import sample.real.RealBuffer; - public class FloatBufferTap extends FloatTap implements Listener { private final static Logger mLog = diff --git a/src/instrument/tap/stream/FloatTap.java b/src/main/java/io/github/dsheirer/instrument/tap/stream/FloatTap.java similarity index 88% rename from src/instrument/tap/stream/FloatTap.java rename to src/main/java/io/github/dsheirer/instrument/tap/stream/FloatTap.java index 1d94daff..156ce76f 100644 --- a/src/instrument/tap/stream/FloatTap.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/stream/FloatTap.java @@ -15,11 +15,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.tap.stream; +package io.github.dsheirer.instrument.tap.stream; -import instrument.tap.TapListener; -import instrument.tap.TapType; -import sample.real.RealSampleListener; +import io.github.dsheirer.instrument.tap.TapListener; +import io.github.dsheirer.instrument.tap.TapType; +import io.github.dsheirer.sample.real.RealSampleListener; public class FloatTap extends StreamTap implements RealSampleListener { diff --git a/src/instrument/tap/stream/FloatTapPhaseViewPanel.java b/src/main/java/io/github/dsheirer/instrument/tap/stream/FloatTapPhaseViewPanel.java similarity index 93% rename from src/instrument/tap/stream/FloatTapPhaseViewPanel.java rename to src/main/java/io/github/dsheirer/instrument/tap/stream/FloatTapPhaseViewPanel.java index 5c942fd9..7810684e 100644 --- a/src/instrument/tap/stream/FloatTapPhaseViewPanel.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/stream/FloatTapPhaseViewPanel.java @@ -15,23 +15,20 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.tap.stream; +package io.github.dsheirer.instrument.tap.stream; -import instrument.gui.SampleModel; -import instrument.tap.Tap; -import instrument.tap.TapViewPanel; +import io.github.dsheirer.instrument.gui.SampleModel; +import io.github.dsheirer.instrument.tap.Tap; +import io.github.dsheirer.instrument.tap.TapViewPanel; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; -import java.awt.Color; -import java.awt.Graphics; -import java.awt.Graphics2D; +import java.awt.*; import java.awt.geom.Path2D; import java.awt.geom.Point2D; import java.util.List; import java.util.Observable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class FloatTapPhaseViewPanel extends TapViewPanel { private final static Logger mLog = diff --git a/src/instrument/tap/stream/FloatTapViewPanel.java b/src/main/java/io/github/dsheirer/instrument/tap/stream/FloatTapViewPanel.java similarity index 92% rename from src/instrument/tap/stream/FloatTapViewPanel.java rename to src/main/java/io/github/dsheirer/instrument/tap/stream/FloatTapViewPanel.java index cc32c802..b89eeafb 100644 --- a/src/instrument/tap/stream/FloatTapViewPanel.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/stream/FloatTapViewPanel.java @@ -15,24 +15,21 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.tap.stream; +package io.github.dsheirer.instrument.tap.stream; -import gui.SDRTrunk; -import instrument.gui.SampleModel; -import instrument.tap.Tap; -import instrument.tap.TapViewPanel; +import io.github.dsheirer.gui.SDRTrunk; +import io.github.dsheirer.instrument.gui.SampleModel; +import io.github.dsheirer.instrument.tap.Tap; +import io.github.dsheirer.instrument.tap.TapViewPanel; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; -import java.awt.Color; -import java.awt.Graphics; -import java.awt.Graphics2D; +import java.awt.*; import java.awt.geom.Path2D; import java.awt.geom.Point2D; import java.util.List; import java.util.Observable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class FloatTapViewPanel extends TapViewPanel { private static final long serialVersionUID = 1L; diff --git a/src/instrument/tap/stream/GainFloatTap.java b/src/main/java/io/github/dsheirer/instrument/tap/stream/GainFloatTap.java similarity index 96% rename from src/instrument/tap/stream/GainFloatTap.java rename to src/main/java/io/github/dsheirer/instrument/tap/stream/GainFloatTap.java index 3a064a00..cc75bc69 100644 --- a/src/instrument/tap/stream/GainFloatTap.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/stream/GainFloatTap.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.tap.stream; +package io.github.dsheirer.instrument.tap.stream; public class GainFloatTap extends FloatTap diff --git a/src/instrument/tap/stream/QPSKTap.java b/src/main/java/io/github/dsheirer/instrument/tap/stream/QPSKTap.java similarity index 64% rename from src/instrument/tap/stream/QPSKTap.java rename to src/main/java/io/github/dsheirer/instrument/tap/stream/QPSKTap.java index 55f598f9..7af8728b 100644 --- a/src/instrument/tap/stream/QPSKTap.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/stream/QPSKTap.java @@ -1,6 +1,6 @@ -package instrument.tap.stream; +package io.github.dsheirer.instrument.tap.stream; -import instrument.tap.TapType; +import io.github.dsheirer.instrument.tap.TapType; public class QPSKTap extends ComplexTap { diff --git a/src/instrument/tap/stream/QPSKTapPanel.java b/src/main/java/io/github/dsheirer/instrument/tap/stream/QPSKTapPanel.java similarity index 92% rename from src/instrument/tap/stream/QPSKTapPanel.java rename to src/main/java/io/github/dsheirer/instrument/tap/stream/QPSKTapPanel.java index f92773f1..6836ebdb 100644 --- a/src/instrument/tap/stream/QPSKTapPanel.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/stream/QPSKTapPanel.java @@ -15,24 +15,20 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.tap.stream; - -import gui.SDRTrunk; -import instrument.gui.SampleModel; -import instrument.tap.Tap; -import instrument.tap.TapViewPanel; - -import java.awt.Color; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.geom.Ellipse2D; -import java.util.List; -import java.util.Observable; +package io.github.dsheirer.instrument.tap.stream; +import io.github.dsheirer.gui.SDRTrunk; +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.sample.complex.Complex; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.complex.Complex; +import java.awt.*; +import java.awt.geom.Ellipse2D; +import java.util.List; +import java.util.Observable; public class QPSKTapPanel extends TapViewPanel { diff --git a/src/instrument/tap/stream/StreamTap.java b/src/main/java/io/github/dsheirer/instrument/tap/stream/StreamTap.java similarity index 89% rename from src/instrument/tap/stream/StreamTap.java rename to src/main/java/io/github/dsheirer/instrument/tap/stream/StreamTap.java index 28ed549c..607fc994 100644 --- a/src/instrument/tap/stream/StreamTap.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/stream/StreamTap.java @@ -15,10 +15,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.tap.stream; +package io.github.dsheirer.instrument.tap.stream; -import instrument.tap.Tap; -import instrument.tap.TapType; +import io.github.dsheirer.instrument.tap.Tap; +import io.github.dsheirer.instrument.tap.TapType; public abstract class StreamTap extends Tap { diff --git a/src/instrument/tap/stream/SymbolEventTap.java b/src/main/java/io/github/dsheirer/instrument/tap/stream/SymbolEventTap.java similarity index 86% rename from src/instrument/tap/stream/SymbolEventTap.java rename to src/main/java/io/github/dsheirer/instrument/tap/stream/SymbolEventTap.java index 9763f090..8954be23 100644 --- a/src/instrument/tap/stream/SymbolEventTap.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/stream/SymbolEventTap.java @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.tap.stream; +package io.github.dsheirer.instrument.tap.stream; -import instrument.tap.TapListener; -import instrument.tap.TapType; -import sample.Listener; -import dsp.symbol.SymbolEvent; +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; public class SymbolEventTap extends StreamTap implements Listener { diff --git a/src/instrument/tap/stream/SymbolEventTapViewPanel.java b/src/main/java/io/github/dsheirer/instrument/tap/stream/SymbolEventTapViewPanel.java similarity index 95% rename from src/instrument/tap/stream/SymbolEventTapViewPanel.java rename to src/main/java/io/github/dsheirer/instrument/tap/stream/SymbolEventTapViewPanel.java index 32c6ec99..fb271bcb 100644 --- a/src/instrument/tap/stream/SymbolEventTapViewPanel.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/stream/SymbolEventTapViewPanel.java @@ -15,22 +15,18 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package instrument.tap.stream; +package io.github.dsheirer.instrument.tap.stream; -import instrument.gui.SampleModel; -import instrument.tap.TapViewPanel; +import io.github.dsheirer.dsp.symbol.SymbolEvent; +import io.github.dsheirer.instrument.gui.SampleModel; +import io.github.dsheirer.instrument.tap.TapViewPanel; -import java.awt.Color; -import java.awt.FontMetrics; -import java.awt.Graphics; -import java.awt.Graphics2D; +import java.awt.*; import java.awt.geom.Path2D; import java.awt.geom.Rectangle2D; import java.util.List; import java.util.Observable; -import dsp.symbol.SymbolEvent; - public class SymbolEventTapViewPanel extends TapViewPanel { private static final long serialVersionUID = 1L; diff --git a/src/main/java/io/github/dsheirer/map/DefaultIcon.java b/src/main/java/io/github/dsheirer/map/DefaultIcon.java new file mode 100644 index 00000000..bb8f6951 --- /dev/null +++ b/src/main/java/io/github/dsheirer/map/DefaultIcon.java @@ -0,0 +1,40 @@ +/* + * ********************************************************************************************************************* + * 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 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 + * ********************************************************************************************************************* + */ +package io.github.dsheirer.map; + +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.github.dsheirer.settings.Setting; +import io.github.dsheirer.settings.SettingType; + +public class DefaultIcon extends Setting +{ + public DefaultIcon(String name) + { + super(name); + } + + public DefaultIcon() + { + } + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + @Override + public SettingType getType() + { + return SettingType.DEFAULT_ICON; + } +} diff --git a/src/main/java/io/github/dsheirer/map/MapIcon.java b/src/main/java/io/github/dsheirer/map/MapIcon.java new file mode 100644 index 00000000..d1be4647 --- /dev/null +++ b/src/main/java/io/github/dsheirer/map/MapIcon.java @@ -0,0 +1,197 @@ +/******************************************************************************* + * 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 + ******************************************************************************/ +package io.github.dsheirer.map; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.github.dsheirer.settings.Setting; +import io.github.dsheirer.settings.SettingType; + +import javax.swing.*; +import java.awt.*; + +public class MapIcon extends Setting implements Comparable +{ + private static final int sMAX_IMAGE_DIMENSION = 48; + private String mPath; + private ImageIcon mImageIcon; + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + @Override + public SettingType getType() + { + return SettingType.MAP_ICON; + } + + /** + * Only map icons created at runtime can be marked as non-editable, and + * therefore this property is transient. + */ + @JsonIgnore + private boolean mEditable; + + @JsonIgnore + 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); + } + + /** + * 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; + } + + @JsonIgnore + 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()); + } +} diff --git a/src/map/MapMouseListener.java b/src/main/java/io/github/dsheirer/map/MapMouseListener.java similarity index 95% rename from src/map/MapMouseListener.java rename to src/main/java/io/github/dsheirer/map/MapMouseListener.java index ff5ed54d..92e879df 100644 --- a/src/map/MapMouseListener.java +++ b/src/main/java/io/github/dsheirer/map/MapMouseListener.java @@ -15,27 +15,21 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package map; +package io.github.dsheirer.map; -import java.awt.Cursor; -import java.awt.Point; -import java.awt.Rectangle; +import io.github.dsheirer.settings.SettingsManager; +import org.jdesktop.swingx.JXMapViewer; +import org.jdesktop.swingx.mapviewer.GeoPosition; + +import javax.swing.*; +import javax.swing.event.MouseInputAdapter; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import java.awt.event.MouseWheelListener; import java.awt.geom.Point2D; -import javax.swing.JMenuItem; -import javax.swing.JPopupMenu; -import javax.swing.SwingUtilities; -import javax.swing.event.MouseInputAdapter; - -import org.jdesktop.swingx.JXMapViewer; -import org.jdesktop.swingx.mapviewer.GeoPosition; - -import settings.SettingsManager; - public class MapMouseListener extends MouseInputAdapter implements MouseWheelListener { private JXMapViewer mJXMapViewer; diff --git a/src/map/MapPanel.java b/src/main/java/io/github/dsheirer/map/MapPanel.java similarity index 96% rename from src/map/MapPanel.java rename to src/main/java/io/github/dsheirer/map/MapPanel.java index 9785472d..17fcf983 100644 --- a/src/map/MapPanel.java +++ b/src/main/java/io/github/dsheirer/map/MapPanel.java @@ -16,9 +16,11 @@ * along with this program. If not, see * ******************************************************************************/ -package map; +package io.github.dsheirer.map; -import icon.IconManager; +import io.github.dsheirer.icon.IconManager; +import io.github.dsheirer.settings.MapViewSetting; +import io.github.dsheirer.settings.SettingsManager; import net.miginfocom.swing.MigLayout; import org.jdesktop.swingx.JXMapViewer; import org.jdesktop.swingx.OSMTileFactoryInfo; @@ -27,8 +29,6 @@ import org.jdesktop.swingx.input.ZoomMouseWheelListenerCursor; import org.jdesktop.swingx.mapviewer.DefaultTileFactory; import org.jdesktop.swingx.mapviewer.GeoPosition; import org.jdesktop.swingx.mapviewer.TileFactoryInfo; -import settings.MapViewSetting; -import settings.SettingsManager; import javax.swing.*; import java.awt.*; diff --git a/src/map/MapService.java b/src/main/java/io/github/dsheirer/map/MapService.java similarity index 95% rename from src/map/MapService.java rename to src/main/java/io/github/dsheirer/map/MapService.java index a2150731..80d53f77 100644 --- a/src/map/MapService.java +++ b/src/main/java/io/github/dsheirer/map/MapService.java @@ -16,12 +16,12 @@ * along with this program. If not, see * ******************************************************************************/ -package map; +package io.github.dsheirer.map; -import alias.Alias; -import icon.IconManager; -import message.Message; -import sample.Listener; +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 java.awt.*; import java.util.ArrayList; diff --git a/src/map/Plottable.java b/src/main/java/io/github/dsheirer/map/Plottable.java similarity index 97% rename from src/map/Plottable.java rename to src/main/java/io/github/dsheirer/map/Plottable.java index 424de6cc..3c8a0113 100644 --- a/src/map/Plottable.java +++ b/src/main/java/io/github/dsheirer/map/Plottable.java @@ -15,13 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package map; - -import java.util.HashMap; +package io.github.dsheirer.map; +import io.github.dsheirer.alias.Alias; import org.jdesktop.swingx.mapviewer.GeoPosition; -import alias.Alias; +import java.util.HashMap; public class Plottable implements Comparable { diff --git a/src/map/PlottableEntity.java b/src/main/java/io/github/dsheirer/map/PlottableEntity.java similarity index 97% rename from src/map/PlottableEntity.java rename to src/main/java/io/github/dsheirer/map/PlottableEntity.java index 01972a41..62bfb474 100644 --- a/src/map/PlottableEntity.java +++ b/src/main/java/io/github/dsheirer/map/PlottableEntity.java @@ -15,17 +15,16 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package map; +package io.github.dsheirer.map; -import java.awt.Color; +import io.github.dsheirer.alias.Alias; +import org.jdesktop.swingx.mapviewer.GeoPosition; + +import java.awt.*; import java.util.Collections; import java.util.Set; import java.util.TreeSet; -import org.jdesktop.swingx.mapviewer.GeoPosition; - -import alias.Alias; - public class PlottableEntity implements Comparable { private TreeSet mPlottables = new TreeSet(); diff --git a/src/map/PlottableEntityPainter.java b/src/main/java/io/github/dsheirer/map/PlottableEntityPainter.java similarity index 95% rename from src/map/PlottableEntityPainter.java rename to src/main/java/io/github/dsheirer/map/PlottableEntityPainter.java index 17f7d6df..bc7960aa 100644 --- a/src/map/PlottableEntityPainter.java +++ b/src/main/java/io/github/dsheirer/map/PlottableEntityPainter.java @@ -1,79 +1,79 @@ - -/******************************************************************************* - * 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 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 - * - ******************************************************************************/ -package map; - -import icon.IconManager; -import org.jdesktop.swingx.JXMapViewer; -import org.jdesktop.swingx.painter.AbstractPainter; - -import java.awt.*; -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - -public class PlottableEntityPainter extends AbstractPainter -{ - private PlottableEntityRenderer mRenderer; - private Set mEntities = new HashSet(); - - public PlottableEntityPainter(IconManager iconManager) - { - mRenderer = new PlottableEntityRenderer(iconManager); - setAntialiasing(true); - setCacheable(false); - } - - public void addEntity(PlottableEntity entity) - { - mEntities.add(entity); - } - - public void removeEntity(PlottableEntity entity) - { - mEntities.remove(entity); - } - - public void clearEntities() - { - mEntities.clear(); - } - - private Set getEntities() - { - return Collections.unmodifiableSet(mEntities); - } - - @Override - protected void doPaint(Graphics2D g, JXMapViewer map, int width, int height) - { - Rectangle viewportBounds = map.getViewportBounds(); - - g.translate(-viewportBounds.getX(), -viewportBounds.getY()); - - Set entities = getEntities(); - - for(PlottableEntity entity : entities) - { - mRenderer.paintPlottableEntity(g, map, entity, true); - } - - g.translate(viewportBounds.getX(), viewportBounds.getY()); - } -} + +/******************************************************************************* + * 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 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 + * + ******************************************************************************/ +package io.github.dsheirer.map; + +import io.github.dsheirer.icon.IconManager; +import org.jdesktop.swingx.JXMapViewer; +import org.jdesktop.swingx.painter.AbstractPainter; + +import java.awt.*; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +public class PlottableEntityPainter extends AbstractPainter +{ + private PlottableEntityRenderer mRenderer; + private Set mEntities = new HashSet(); + + public PlottableEntityPainter(IconManager iconManager) + { + mRenderer = new PlottableEntityRenderer(iconManager); + setAntialiasing(true); + setCacheable(false); + } + + public void addEntity(PlottableEntity entity) + { + mEntities.add(entity); + } + + public void removeEntity(PlottableEntity entity) + { + mEntities.remove(entity); + } + + public void clearEntities() + { + mEntities.clear(); + } + + private Set getEntities() + { + return Collections.unmodifiableSet(mEntities); + } + + @Override + protected void doPaint(Graphics2D g, JXMapViewer map, int width, int height) + { + Rectangle viewportBounds = map.getViewportBounds(); + + g.translate(-viewportBounds.getX(), -viewportBounds.getY()); + + Set entities = getEntities(); + + for(PlottableEntity entity : entities) + { + mRenderer.paintPlottableEntity(g, map, entity, true); + } + + g.translate(viewportBounds.getX(), viewportBounds.getY()); + } +} diff --git a/src/map/PlottableEntityRenderer.java b/src/main/java/io/github/dsheirer/map/PlottableEntityRenderer.java similarity index 98% rename from src/map/PlottableEntityRenderer.java rename to src/main/java/io/github/dsheirer/map/PlottableEntityRenderer.java index 82358610..d7136de9 100644 --- a/src/map/PlottableEntityRenderer.java +++ b/src/main/java/io/github/dsheirer/map/PlottableEntityRenderer.java @@ -16,9 +16,9 @@ * along with this program. If not, see * ******************************************************************************/ -package map; +package io.github.dsheirer.map; -import icon.IconManager; +import io.github.dsheirer.icon.IconManager; import org.jdesktop.swingx.JXMapViewer; import javax.swing.*; diff --git a/src/map/PlottableUpdateListener.java b/src/main/java/io/github/dsheirer/map/PlottableUpdateListener.java similarity index 97% rename from src/map/PlottableUpdateListener.java rename to src/main/java/io/github/dsheirer/map/PlottableUpdateListener.java index d239aa0c..cd24aca0 100644 --- a/src/map/PlottableUpdateListener.java +++ b/src/main/java/io/github/dsheirer/map/PlottableUpdateListener.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package map; +package io.github.dsheirer.map; public interface PlottableUpdateListener { diff --git a/src/map/SelectionAdapter.java b/src/main/java/io/github/dsheirer/map/SelectionAdapter.java similarity index 98% rename from src/map/SelectionAdapter.java rename to src/main/java/io/github/dsheirer/map/SelectionAdapter.java index 62c2c9df..6c38cf31 100644 --- a/src/map/SelectionAdapter.java +++ b/src/main/java/io/github/dsheirer/map/SelectionAdapter.java @@ -15,15 +15,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package map; +package io.github.dsheirer.map; -import java.awt.Rectangle; +import org.jdesktop.swingx.JXMapViewer; + +import java.awt.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.geom.Point2D; -import org.jdesktop.swingx.JXMapViewer; - /** * Creates a selection rectangle based on mouse input * Also triggers repaint events in the viewer diff --git a/src/map/SelectionPainter.java b/src/main/java/io/github/dsheirer/map/SelectionPainter.java similarity index 94% rename from src/map/SelectionPainter.java rename to src/main/java/io/github/dsheirer/map/SelectionPainter.java index 5ed7a5aa..e8bb0a8a 100644 --- a/src/map/SelectionPainter.java +++ b/src/main/java/io/github/dsheirer/map/SelectionPainter.java @@ -15,14 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package map; - -import java.awt.Color; -import java.awt.Graphics2D; -import java.awt.Rectangle; +package io.github.dsheirer.map; import org.jdesktop.swingx.painter.Painter; +import java.awt.*; + /** * Paints a selection rectangle * @author Martin Steiger diff --git a/src/message/IMessageListener.java b/src/main/java/io/github/dsheirer/message/IMessageListener.java similarity index 52% rename from src/message/IMessageListener.java rename to src/main/java/io/github/dsheirer/message/IMessageListener.java index 9c176e52..b8d26c9b 100644 --- a/src/message/IMessageListener.java +++ b/src/main/java/io/github/dsheirer/message/IMessageListener.java @@ -1,6 +1,6 @@ -package message; +package io.github.dsheirer.message; -import sample.Listener; +import io.github.dsheirer.sample.Listener; public interface IMessageListener { diff --git a/src/message/IMessageProvider.java b/src/main/java/io/github/dsheirer/message/IMessageProvider.java similarity index 64% rename from src/message/IMessageProvider.java rename to src/main/java/io/github/dsheirer/message/IMessageProvider.java index 41b29ac3..7f3fbfd4 100644 --- a/src/message/IMessageProvider.java +++ b/src/main/java/io/github/dsheirer/message/IMessageProvider.java @@ -1,6 +1,6 @@ -package message; +package io.github.dsheirer.message; -import sample.Listener; +import io.github.dsheirer.sample.Listener; public interface IMessageProvider { diff --git a/src/message/Message.java b/src/main/java/io/github/dsheirer/message/Message.java similarity index 93% rename from src/message/Message.java rename to src/main/java/io/github/dsheirer/message/Message.java index 33fcef25..1ff480e2 100644 --- a/src/message/Message.java +++ b/src/main/java/io/github/dsheirer/message/Message.java @@ -15,14 +15,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package message; +package io.github.dsheirer.message; + +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.map.Plottable; import java.util.Collections; import java.util.List; -import map.Plottable; -import alias.Alias; - public abstract class Message { protected long mTimeReceived; @@ -106,7 +106,7 @@ public abstract class Message /** - * Provides a listing of aliases contained in the message. + * Provides a listing of aliases contained in the message. */ public List getAliases() { diff --git a/src/message/MessageDirection.java b/src/main/java/io/github/dsheirer/message/MessageDirection.java similarity index 97% rename from src/message/MessageDirection.java rename to src/main/java/io/github/dsheirer/message/MessageDirection.java index 87d8e7d2..1ebca368 100644 --- a/src/message/MessageDirection.java +++ b/src/main/java/io/github/dsheirer/message/MessageDirection.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package message; +package io.github.dsheirer.message; public enum MessageDirection { diff --git a/src/message/MessageType.java b/src/main/java/io/github/dsheirer/message/MessageType.java similarity index 98% rename from src/message/MessageType.java rename to src/main/java/io/github/dsheirer/message/MessageType.java index 6b046efb..5c569561 100644 --- a/src/message/MessageType.java +++ b/src/main/java/io/github/dsheirer/message/MessageType.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package message; +package io.github.dsheirer.message; public enum MessageType { diff --git a/src/module/Module.java b/src/main/java/io/github/dsheirer/module/Module.java similarity index 97% rename from src/module/Module.java rename to src/main/java/io/github/dsheirer/module/Module.java index a46b3e9c..ce1253d6 100644 --- a/src/module/Module.java +++ b/src/main/java/io/github/dsheirer/module/Module.java @@ -16,7 +16,7 @@ * along with this program. If not, see ******************************************************************************/ -package module; +package io.github.dsheirer.module; import java.util.concurrent.ScheduledExecutorService; @@ -49,11 +49,11 @@ public abstract class Module /** * Initialize or reset all internal states to default - prepare to start - * processing or resume processing, potentially with a different source. + * processing or resume processing, potentially with a different source. * * This method is invoked after constructing a module, and following any stop() - * calls and before any start() calls. This allows the module to prior to - * starting a module and starting it again processing a newly tuned channel, + * calls and before any start() calls. This allows the module to prior to + * starting a module and starting it again processing a newly tuned channel, * like a traffic channel. */ public abstract void reset(); diff --git a/src/module/ProcessingChain.java b/src/main/java/io/github/dsheirer/module/ProcessingChain.java similarity index 88% rename from src/module/ProcessingChain.java rename to src/main/java/io/github/dsheirer/module/ProcessingChain.java index 5eaa4cbb..391d999f 100644 --- a/src/module/ProcessingChain.java +++ b/src/main/java/io/github/dsheirer/module/ProcessingChain.java @@ -16,58 +16,58 @@ * along with this program. If not, see * ******************************************************************************/ -package module; +package io.github.dsheirer.module; -import audio.AudioPacket; -import audio.IAudioPacketListener; -import audio.IAudioPacketProvider; -import audio.squelch.ISquelchStateListener; -import audio.squelch.ISquelchStateProvider; -import audio.squelch.SquelchState; -import channel.heartbeat.Heartbeat; -import channel.heartbeat.IHeartbeatListener; -import channel.heartbeat.IHeartbeatProvider; -import channel.metadata.AttributeChangeRequest; -import channel.metadata.IAttributeChangeRequestListener; -import channel.metadata.IAttributeChangeRequestProvider; -import channel.state.ChannelState; -import channel.state.DecoderState; -import channel.state.DecoderStateEvent; -import channel.state.IDecoderStateEventListener; -import channel.state.IDecoderStateEventProvider; -import controller.channel.Channel.ChannelType; -import controller.channel.ChannelEvent; -import controller.channel.IChannelEventListener; -import controller.channel.IChannelEventProvider; -import message.IMessageListener; -import message.IMessageProvider; -import message.Message; -import module.decode.event.CallEvent; -import module.decode.event.CallEventModel; -import module.decode.event.ICallEventListener; -import module.decode.event.ICallEventProvider; -import module.decode.event.MessageActivityModel; -import module.log.EventLogger; +import io.github.dsheirer.audio.AudioPacket; +import io.github.dsheirer.audio.IAudioPacketListener; +import io.github.dsheirer.audio.IAudioPacketProvider; +import io.github.dsheirer.audio.squelch.ISquelchStateListener; +import io.github.dsheirer.audio.squelch.ISquelchStateProvider; +import io.github.dsheirer.audio.squelch.SquelchState; +import io.github.dsheirer.channel.heartbeat.Heartbeat; +import io.github.dsheirer.channel.heartbeat.IHeartbeatListener; +import io.github.dsheirer.channel.heartbeat.IHeartbeatProvider; +import io.github.dsheirer.channel.metadata.AttributeChangeRequest; +import io.github.dsheirer.channel.metadata.IAttributeChangeRequestListener; +import io.github.dsheirer.channel.metadata.IAttributeChangeRequestProvider; +import io.github.dsheirer.channel.state.ChannelState; +import io.github.dsheirer.channel.state.DecoderState; +import io.github.dsheirer.channel.state.DecoderStateEvent; +import io.github.dsheirer.channel.state.IDecoderStateEventListener; +import io.github.dsheirer.channel.state.IDecoderStateEventProvider; +import io.github.dsheirer.controller.channel.Channel.ChannelType; +import io.github.dsheirer.controller.channel.ChannelEvent; +import io.github.dsheirer.controller.channel.IChannelEventListener; +import io.github.dsheirer.controller.channel.IChannelEventProvider; +import io.github.dsheirer.message.IMessageListener; +import io.github.dsheirer.message.IMessageProvider; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.module.decode.event.CallEvent; +import io.github.dsheirer.module.decode.event.CallEventModel; +import io.github.dsheirer.module.decode.event.ICallEventListener; +import io.github.dsheirer.module.decode.event.ICallEventProvider; +import io.github.dsheirer.module.decode.event.MessageActivityModel; +import io.github.dsheirer.module.log.EventLogger; +import io.github.dsheirer.record.wave.ComplexBufferWaveRecorder; +import io.github.dsheirer.record.wave.RealBufferWaveRecorder; +import io.github.dsheirer.sample.Broadcaster; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.ComplexBuffer; +import io.github.dsheirer.sample.complex.IComplexBufferListener; +import io.github.dsheirer.sample.real.IFilteredRealBufferListener; +import io.github.dsheirer.sample.real.IFilteredRealBufferProvider; +import io.github.dsheirer.sample.real.IUnFilteredRealBufferListener; +import io.github.dsheirer.sample.real.IUnFilteredRealBufferProvider; +import io.github.dsheirer.sample.real.RealBuffer; +import io.github.dsheirer.source.ComplexSource; +import io.github.dsheirer.source.RealSource; +import io.github.dsheirer.source.Source; +import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent; +import io.github.dsheirer.source.tuner.frequency.IFrequencyChangeListener; +import io.github.dsheirer.source.tuner.frequency.IFrequencyChangeProvider; +import io.github.dsheirer.util.ThreadPool; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import record.wave.ComplexBufferWaveRecorder; -import record.wave.RealBufferWaveRecorder; -import sample.Broadcaster; -import sample.Listener; -import sample.complex.ComplexBuffer; -import sample.complex.IComplexBufferListener; -import sample.real.IFilteredRealBufferListener; -import sample.real.IFilteredRealBufferProvider; -import sample.real.IUnFilteredRealBufferListener; -import sample.real.IUnFilteredRealBufferProvider; -import sample.real.RealBuffer; -import source.ComplexSource; -import source.RealSource; -import source.Source; -import source.tuner.frequency.FrequencyChangeEvent; -import source.tuner.frequency.IFrequencyChangeListener; -import source.tuner.frequency.IFrequencyChangeProvider; -import util.ThreadPool; import java.util.ArrayList; import java.util.List; @@ -190,13 +190,11 @@ public class ProcessingChain implements IChannelEventListener } /** - * Applies a sample source to this processing chain. Processing won't - * start until the start() method is invoked. + * Applies a source to this processing chain. Processing won't start until the start() method is invoked. * - * @param source - real or complex sample source - * @throws IllegalStateException if the processing chain is currently - * processing with another source. Invoke stop() before applying a new - * source. + * @param source - real or complex source + * @throws IllegalStateException if the processing chain is currently processing with another source. Invoke stop() + * before applying a new source. */ public void setSource(Source source) throws IllegalStateException { @@ -565,8 +563,8 @@ public class ProcessingChain implements IChannelEventListener //Setup the channel state to monitor source overflow conditions mSource.setOverflowListener(mChannelState); - /* Register with the source to receive sample data. Setup a - * timer task to process the buffer queues 50 times a second + /* Register with the source to receive sample data. Setup a + * timer task to process the buffer queues 50 times a second * (every 20 ms) */ switch(mSource.getSampleType()) { diff --git a/src/module/decode/AuxDecodeConfigurationEditor.java b/src/main/java/io/github/dsheirer/module/decode/AuxDecodeConfigurationEditor.java similarity index 93% rename from src/module/decode/AuxDecodeConfigurationEditor.java rename to src/main/java/io/github/dsheirer/module/decode/AuxDecodeConfigurationEditor.java index 0e40834a..caee7e25 100644 --- a/src/module/decode/AuxDecodeConfigurationEditor.java +++ b/src/main/java/io/github/dsheirer/module/decode/AuxDecodeConfigurationEditor.java @@ -15,22 +15,20 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode; +package io.github.dsheirer.module.decode; -import gui.editor.Editor; +import io.github.dsheirer.controller.channel.Channel; +import io.github.dsheirer.gui.editor.Editor; +import io.github.dsheirer.module.decode.config.AuxDecodeConfiguration; +import net.miginfocom.swing.MigLayout; +import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import javax.swing.JCheckBox; - -import module.decode.config.AuxDecodeConfiguration; -import net.miginfocom.swing.MigLayout; -import controller.channel.Channel; - public class AuxDecodeConfigurationEditor extends Editor { private static final long serialVersionUID = 1L; diff --git a/src/module/decode/DecodeConfigurationEditor.java b/src/main/java/io/github/dsheirer/module/decode/DecodeConfigurationEditor.java similarity index 89% rename from src/module/decode/DecodeConfigurationEditor.java rename to src/main/java/io/github/dsheirer/module/decode/DecodeConfigurationEditor.java index d8a9f784..7cfb1ba8 100644 --- a/src/module/decode/DecodeConfigurationEditor.java +++ b/src/main/java/io/github/dsheirer/module/decode/DecodeConfigurationEditor.java @@ -15,23 +15,20 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode; +package io.github.dsheirer.module.decode; -import gui.editor.Editor; -import gui.editor.EditorValidationException; -import gui.editor.EmptyValidatingEditor; -import gui.editor.ValidatingEditor; +import io.github.dsheirer.controller.channel.Channel; +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.gui.editor.EmptyValidatingEditor; +import io.github.dsheirer.gui.editor.ValidatingEditor; +import net.miginfocom.swing.MigLayout; +import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import javax.swing.DefaultComboBoxModel; -import javax.swing.JComboBox; - -import net.miginfocom.swing.MigLayout; -import controller.channel.Channel; -import controller.channel.map.ChannelMapModel; - public class DecodeConfigurationEditor extends ValidatingEditor { private static final long serialVersionUID = 1L; diff --git a/src/module/decode/Decoder.java b/src/main/java/io/github/dsheirer/module/decode/Decoder.java similarity index 88% rename from src/module/decode/Decoder.java rename to src/main/java/io/github/dsheirer/module/decode/Decoder.java index cc6880a7..9efeb0e7 100644 --- a/src/module/decode/Decoder.java +++ b/src/main/java/io/github/dsheirer/module/decode/Decoder.java @@ -15,14 +15,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode; +package io.github.dsheirer.module.decode; -import message.IMessageProvider; -import message.Message; -import module.Module; -import sample.Listener; +import io.github.dsheirer.message.IMessageProvider; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.module.Module; +import io.github.dsheirer.sample.Listener; -public abstract class Decoder extends Module +public abstract class Decoder extends Module implements IMessageProvider, Listener { /* This has to be a broadcaster in order for references to persist */ diff --git a/src/module/decode/DecoderFactory.java b/src/main/java/io/github/dsheirer/module/decode/DecoderFactory.java similarity index 79% rename from src/module/decode/DecoderFactory.java rename to src/main/java/io/github/dsheirer/module/decode/DecoderFactory.java index 4b8cbf1e..29dbcf5b 100644 --- a/src/module/decode/DecoderFactory.java +++ b/src/main/java/io/github/dsheirer/module/decode/DecoderFactory.java @@ -16,81 +16,80 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode; +package io.github.dsheirer.module.decode; -import alias.AliasList; -import alias.AliasModel; -import audio.AudioModule; -import channel.metadata.Metadata; -import channel.state.AlwaysUnsquelchedDecoderState; -import channel.traffic.TrafficChannelManager; -import controller.channel.Channel; -import controller.channel.Channel.ChannelType; -import controller.channel.ChannelModel; -import controller.channel.ChannelProcessingManager; -import controller.channel.map.ChannelMap; -import controller.channel.map.ChannelMapModel; -import dsp.filter.FilterFactory; -import dsp.filter.fir.FIRFilterSpecification; -import filter.AllPassFilter; -import filter.FilterSet; -import filter.IFilter; -import gui.editor.EmptyValidatingEditor; -import gui.editor.ValidatingEditor; -import message.Message; -import message.MessageDirection; -import module.Module; -import module.decode.am.AMDecoder; -import module.decode.am.AMDecoderEditor; -import module.decode.am.DecodeConfigAM; -import module.decode.config.AuxDecodeConfiguration; -import module.decode.config.DecodeConfiguration; -import module.decode.fleetsync2.Fleetsync2Decoder; -import module.decode.fleetsync2.Fleetsync2DecoderState; -import module.decode.fleetsync2.FleetsyncMessageFilter; -import module.decode.lj1200.LJ1200Decoder; -import module.decode.lj1200.LJ1200DecoderState; -import module.decode.lj1200.LJ1200MessageFilter; -import module.decode.ltrnet.DecodeConfigLTRNet; -import module.decode.ltrnet.LTRNetDecoder; -import module.decode.ltrnet.LTRNetDecoderEditor; -import module.decode.ltrnet.LTRNetDecoderState; -import module.decode.ltrnet.LTRNetMessageFilter; -import module.decode.ltrstandard.DecodeConfigLTRStandard; -import module.decode.ltrstandard.LTRStandardDecoder; -import module.decode.ltrstandard.LTRStandardDecoderEditor; -import module.decode.ltrstandard.LTRStandardDecoderState; -import module.decode.ltrstandard.LTRStandardMessageFilter; -import module.decode.mdc1200.MDCDecoder; -import module.decode.mdc1200.MDCDecoderState; -import module.decode.mdc1200.MDCMessageFilter; -import module.decode.mpt1327.DecodeConfigMPT1327; -import module.decode.mpt1327.MPT1327Decoder; -import module.decode.mpt1327.MPT1327Decoder.Sync; -import module.decode.mpt1327.MPT1327DecoderEditor; -import module.decode.mpt1327.MPT1327DecoderState; -import module.decode.mpt1327.MPT1327MessageFilter; -import module.decode.nbfm.DecodeConfigNBFM; -import module.decode.nbfm.NBFMDecoder; -import module.decode.nbfm.NBFMDecoderEditor; -import module.decode.p25.DecodeConfigP25Phase1; -import module.decode.p25.P25Decoder.Modulation; -import module.decode.p25.P25DecoderEditor; -import module.decode.p25.P25DecoderState; -import module.decode.p25.P25_C4FMDecoder; -import module.decode.p25.P25_LSMDecoder; -import module.decode.p25.audio.P25AudioModule; -import module.decode.p25.message.filter.P25MessageFilterSet; -import module.decode.passport.DecodeConfigPassport; -import module.decode.passport.PassportDecoder; -import module.decode.passport.PassportDecoderEditor; -import module.decode.passport.PassportDecoderState; -import module.decode.passport.PassportMessageFilter; -import module.decode.tait.Tait1200Decoder; -import module.decode.tait.Tait1200DecoderState; -import module.demodulate.am.AMDemodulatorModule; -import module.demodulate.audio.DemodulatedAudioFilterModule; -import module.demodulate.fm.FMDemodulatorModule; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.alias.AliasModel; +import io.github.dsheirer.audio.AudioModule; +import io.github.dsheirer.channel.metadata.Metadata; +import io.github.dsheirer.channel.state.AlwaysUnsquelchedDecoderState; +import io.github.dsheirer.channel.traffic.TrafficChannelManager; +import io.github.dsheirer.controller.channel.Channel; +import io.github.dsheirer.controller.channel.Channel.ChannelType; +import io.github.dsheirer.controller.channel.ChannelModel; +import io.github.dsheirer.controller.channel.ChannelProcessingManager; +import io.github.dsheirer.controller.channel.map.ChannelMap; +import io.github.dsheirer.controller.channel.map.ChannelMapModel; +import io.github.dsheirer.dsp.filter.FilterFactory; +import io.github.dsheirer.dsp.filter.fir.FIRFilterSpecification; +import io.github.dsheirer.filter.AllPassFilter; +import io.github.dsheirer.filter.FilterSet; +import io.github.dsheirer.filter.IFilter; +import io.github.dsheirer.gui.editor.EmptyValidatingEditor; +import io.github.dsheirer.gui.editor.ValidatingEditor; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.message.MessageDirection; +import io.github.dsheirer.module.Module; +import io.github.dsheirer.module.decode.am.AMDecoder; +import io.github.dsheirer.module.decode.am.AMDecoderEditor; +import io.github.dsheirer.module.decode.am.DecodeConfigAM; +import io.github.dsheirer.module.decode.config.AuxDecodeConfiguration; +import io.github.dsheirer.module.decode.config.DecodeConfiguration; +import io.github.dsheirer.module.decode.fleetsync2.Fleetsync2Decoder; +import io.github.dsheirer.module.decode.fleetsync2.Fleetsync2DecoderState; +import io.github.dsheirer.module.decode.fleetsync2.FleetsyncMessageFilter; +import io.github.dsheirer.module.decode.lj1200.LJ1200Decoder; +import io.github.dsheirer.module.decode.lj1200.LJ1200DecoderState; +import io.github.dsheirer.module.decode.lj1200.LJ1200MessageFilter; +import io.github.dsheirer.module.decode.ltrnet.DecodeConfigLTRNet; +import io.github.dsheirer.module.decode.ltrnet.LTRNetDecoder; +import io.github.dsheirer.module.decode.ltrnet.LTRNetDecoderEditor; +import io.github.dsheirer.module.decode.ltrnet.LTRNetDecoderState; +import io.github.dsheirer.module.decode.ltrnet.LTRNetMessageFilter; +import io.github.dsheirer.module.decode.ltrstandard.DecodeConfigLTRStandard; +import io.github.dsheirer.module.decode.ltrstandard.LTRStandardDecoder; +import io.github.dsheirer.module.decode.ltrstandard.LTRStandardDecoderEditor; +import io.github.dsheirer.module.decode.ltrstandard.LTRStandardDecoderState; +import io.github.dsheirer.module.decode.ltrstandard.LTRStandardMessageFilter; +import io.github.dsheirer.module.decode.mdc1200.MDCDecoder; +import io.github.dsheirer.module.decode.mdc1200.MDCDecoderState; +import io.github.dsheirer.module.decode.mdc1200.MDCMessageFilter; +import io.github.dsheirer.module.decode.mpt1327.DecodeConfigMPT1327; +import io.github.dsheirer.module.decode.mpt1327.MPT1327Decoder; +import io.github.dsheirer.module.decode.mpt1327.MPT1327DecoderEditor; +import io.github.dsheirer.module.decode.mpt1327.MPT1327DecoderState; +import io.github.dsheirer.module.decode.mpt1327.MPT1327MessageFilter; +import io.github.dsheirer.module.decode.nbfm.DecodeConfigNBFM; +import io.github.dsheirer.module.decode.nbfm.NBFMDecoder; +import io.github.dsheirer.module.decode.nbfm.NBFMDecoderEditor; +import io.github.dsheirer.module.decode.p25.DecodeConfigP25Phase1; +import io.github.dsheirer.module.decode.p25.P25Decoder; +import io.github.dsheirer.module.decode.p25.P25DecoderEditor; +import io.github.dsheirer.module.decode.p25.P25DecoderState; +import io.github.dsheirer.module.decode.p25.P25_C4FMDecoder; +import io.github.dsheirer.module.decode.p25.P25_LSMDecoder; +import io.github.dsheirer.module.decode.p25.audio.P25AudioModule; +import io.github.dsheirer.module.decode.p25.message.filter.P25MessageFilterSet; +import io.github.dsheirer.module.decode.passport.DecodeConfigPassport; +import io.github.dsheirer.module.decode.passport.PassportDecoder; +import io.github.dsheirer.module.decode.passport.PassportDecoderEditor; +import io.github.dsheirer.module.decode.passport.PassportDecoderState; +import io.github.dsheirer.module.decode.passport.PassportMessageFilter; +import io.github.dsheirer.module.decode.tait.Tait1200Decoder; +import io.github.dsheirer.module.decode.tait.Tait1200DecoderState; +import io.github.dsheirer.module.demodulate.am.AMDemodulatorModule; +import io.github.dsheirer.module.demodulate.audio.DemodulatedAudioFilterModule; +import io.github.dsheirer.module.demodulate.fm.FMDemodulatorModule; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -213,7 +212,7 @@ public class DecoderFactory ChannelMap channelMap = channelMapModel.getChannelMap(mptConfig.getChannelMapName()); - Sync sync = mptConfig.getSync(); + MPT1327Decoder.Sync sync = mptConfig.getSync(); modules.add(new MPT1327Decoder(aliasList, sync)); @@ -241,7 +240,7 @@ public class DecoderFactory case P25_PHASE1: DecodeConfigP25Phase1 p25Config = (DecodeConfigP25Phase1) decodeConfig; - Modulation modulation = p25Config.getModulation(); + P25Decoder.Modulation modulation = p25Config.getModulation(); switch(modulation) @@ -250,12 +249,12 @@ public class DecoderFactory modules.add(new FMDemodulatorModule(P25_C4FM_IQ_FILTER)); modules.add(new DemodulatedAudioFilterModule(P25_C4FM_DEMOD_FILTER, 1.0f)); modules.add(new P25_C4FMDecoder(aliasList, decodeConfig.getAFCMaximumCorrection())); - modules.add(new P25DecoderState(aliasList, channelType, Modulation.C4FM, + modules.add(new P25DecoderState(aliasList, channelType, P25Decoder.Modulation.C4FM, p25Config.getIgnoreDataCalls())); break; case CQPSK: modules.add(new P25_LSMDecoder(aliasList)); - modules.add(new P25DecoderState(aliasList, channelType, Modulation.CQPSK, p25Config.getIgnoreDataCalls())); + modules.add(new P25DecoderState(aliasList, channelType, P25Decoder.Modulation.CQPSK, p25Config.getIgnoreDataCalls())); break; default: throw new IllegalArgumentException("Unrecognized P25 Phase 1 Modulation [" + modulation + "]"); diff --git a/src/module/decode/DecoderType.java b/src/main/java/io/github/dsheirer/module/decode/DecoderType.java similarity index 99% rename from src/module/decode/DecoderType.java rename to src/main/java/io/github/dsheirer/module/decode/DecoderType.java index ca7fee49..42b05e81 100644 --- a/src/module/decode/DecoderType.java +++ b/src/main/java/io/github/dsheirer/module/decode/DecoderType.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode; +package io.github.dsheirer.module.decode; import java.util.ArrayList; import java.util.EnumSet; diff --git a/src/module/decode/PrimaryDecoder.java b/src/main/java/io/github/dsheirer/module/decode/PrimaryDecoder.java similarity index 87% rename from src/module/decode/PrimaryDecoder.java rename to src/main/java/io/github/dsheirer/module/decode/PrimaryDecoder.java index 03380594..be4826fb 100644 --- a/src/module/decode/PrimaryDecoder.java +++ b/src/main/java/io/github/dsheirer/module/decode/PrimaryDecoder.java @@ -16,12 +16,12 @@ * along with this program. If not, see ******************************************************************************/ -package module.decode; +package io.github.dsheirer.module.decode; -import module.decode.config.DecodeConfiguration; -import sample.Listener; -import audio.squelch.ISquelchStateProvider; -import audio.squelch.SquelchState; +import io.github.dsheirer.audio.squelch.ISquelchStateProvider; +import io.github.dsheirer.audio.squelch.SquelchState; +import io.github.dsheirer.module.decode.config.DecodeConfiguration; +import io.github.dsheirer.sample.Listener; /** * Primary decoder adds the following functionality over the basic decoder: diff --git a/src/module/decode/am/AMDecoder.java b/src/main/java/io/github/dsheirer/module/decode/am/AMDecoder.java similarity index 85% rename from src/module/decode/am/AMDecoder.java rename to src/main/java/io/github/dsheirer/module/decode/am/AMDecoder.java index c5b371e3..31362eba 100644 --- a/src/module/decode/am/AMDecoder.java +++ b/src/main/java/io/github/dsheirer/module/decode/am/AMDecoder.java @@ -1,54 +1,54 @@ -/******************************************************************************* - * SDR Trunk - * Copyright (C) 2014,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 - ******************************************************************************/ - -package module.decode.am; - -import java.util.concurrent.ScheduledExecutorService; - -import module.decode.DecoderType; -import module.decode.PrimaryDecoder; -import module.decode.config.DecodeConfiguration; - -public class AMDecoder extends PrimaryDecoder -{ - public AMDecoder( DecodeConfiguration config ) - { - super( config ); - } - - @Override - public DecoderType getDecoderType() - { - return DecoderType.AM; - } - - @Override - public void reset() - { - } - - @Override - public void start( ScheduledExecutorService executor ) - { - } - - @Override - public void stop() - { - } -} +/******************************************************************************* + * SDR Trunk + * Copyright (C) 2014,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 + ******************************************************************************/ + +package io.github.dsheirer.module.decode.am; + +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.module.decode.PrimaryDecoder; +import io.github.dsheirer.module.decode.config.DecodeConfiguration; + +import java.util.concurrent.ScheduledExecutorService; + +public class AMDecoder extends PrimaryDecoder +{ + public AMDecoder( DecodeConfiguration config ) + { + super( config ); + } + + @Override + public DecoderType getDecoderType() + { + return DecoderType.AM; + } + + @Override + public void reset() + { + } + + @Override + public void start( ScheduledExecutorService executor ) + { + } + + @Override + public void stop() + { + } +} diff --git a/src/module/decode/am/AMDecoderEditor.java b/src/main/java/io/github/dsheirer/module/decode/am/AMDecoderEditor.java similarity index 86% rename from src/module/decode/am/AMDecoderEditor.java rename to src/main/java/io/github/dsheirer/module/decode/am/AMDecoderEditor.java index 697f7ebe..56a87460 100644 --- a/src/module/decode/am/AMDecoderEditor.java +++ b/src/main/java/io/github/dsheirer/module/decode/am/AMDecoderEditor.java @@ -15,16 +15,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.am; - -import gui.editor.Editor; -import gui.editor.EditorValidationException; -import gui.editor.ValidatingEditor; - -import javax.swing.JLabel; +package io.github.dsheirer.module.decode.am; +import io.github.dsheirer.controller.channel.Channel; +import io.github.dsheirer.gui.editor.Editor; +import io.github.dsheirer.gui.editor.EditorValidationException; +import io.github.dsheirer.gui.editor.ValidatingEditor; import net.miginfocom.swing.MigLayout; -import controller.channel.Channel; + +import javax.swing.*; public class AMDecoderEditor extends ValidatingEditor { diff --git a/src/module/decode/am/DecodeConfigAM.java b/src/main/java/io/github/dsheirer/module/decode/am/DecodeConfigAM.java similarity index 71% rename from src/module/decode/am/DecodeConfigAM.java rename to src/main/java/io/github/dsheirer/module/decode/am/DecodeConfigAM.java index 844e2543..81024e74 100644 --- a/src/module/decode/am/DecodeConfigAM.java +++ b/src/main/java/io/github/dsheirer/module/decode/am/DecodeConfigAM.java @@ -15,20 +15,25 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.am; +package io.github.dsheirer.module.decode.am; -import module.decode.DecoderType; -import module.decode.config.DecodeConfiguration; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.module.decode.config.DecodeConfiguration; 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; diff --git a/src/module/decode/config/AuxDecodeConfiguration.java b/src/main/java/io/github/dsheirer/module/decode/config/AuxDecodeConfiguration.java similarity index 77% rename from src/module/decode/config/AuxDecodeConfiguration.java rename to src/main/java/io/github/dsheirer/module/decode/config/AuxDecodeConfiguration.java index 044269b8..b37b455f 100644 --- a/src/module/decode/config/AuxDecodeConfiguration.java +++ b/src/main/java/io/github/dsheirer/module/decode/config/AuxDecodeConfiguration.java @@ -15,15 +15,16 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.config; +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 java.util.ArrayList; -import javax.xml.bind.annotation.XmlElement; - -import module.decode.DecoderType; -import controller.config.Configuration; - +@JsonSubTypes.Type(value = AuxDecodeConfiguration.class, name = "auxDecodeConfiguration") public class AuxDecodeConfiguration extends Configuration { ArrayList mAuxDecoders = new ArrayList(); @@ -32,7 +33,7 @@ public class AuxDecodeConfiguration extends Configuration { } - @XmlElement( name="aux_decoder" ) + @JacksonXmlProperty(isAttribute = false, localName = "aux_decoder") public ArrayList getAuxDecoders() { return mAuxDecoders; diff --git a/src/main/java/io/github/dsheirer/module/decode/config/DecodeConfiguration.java b/src/main/java/io/github/dsheirer/module/decode/config/DecodeConfiguration.java new file mode 100644 index 00000000..ca65a6e5 --- /dev/null +++ b/src/main/java/io/github/dsheirer/module/decode/config/DecodeConfiguration.java @@ -0,0 +1,100 @@ +/******************************************************************************* + * 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 + ******************************************************************************/ +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; +import io.github.dsheirer.module.decode.ltrnet.DecodeConfigLTRNet; +import io.github.dsheirer.module.decode.ltrstandard.DecodeConfigLTRStandard; +import io.github.dsheirer.module.decode.mpt1327.DecodeConfigMPT1327; +import io.github.dsheirer.module.decode.nbfm.DecodeConfigNBFM; +import io.github.dsheirer.module.decode.p25.DecodeConfigP25Phase1; +import io.github.dsheirer.module.decode.passport.DecodeConfigPassport; + +@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_AFC_MAX_CORRECTION = 1000; + + private boolean mAFCEnabled = true; + private int mAFCMaxCorrection = DEFAULT_AFC_MAX_CORRECTION; + + 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; + } +} diff --git a/src/module/decode/event/ActivitySummaryFrame.java b/src/main/java/io/github/dsheirer/module/decode/event/ActivitySummaryFrame.java similarity index 91% rename from src/module/decode/event/ActivitySummaryFrame.java rename to src/main/java/io/github/dsheirer/module/decode/event/ActivitySummaryFrame.java index 2530cfc0..426b7ee1 100644 --- a/src/module/decode/event/ActivitySummaryFrame.java +++ b/src/main/java/io/github/dsheirer/module/decode/event/ActivitySummaryFrame.java @@ -15,20 +15,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.event; - -import java.awt.Component; -import java.awt.EventQueue; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.JButton; -import javax.swing.JFrame; -import javax.swing.JScrollPane; -import javax.swing.JTextArea; +package io.github.dsheirer.module.decode.event; import net.miginfocom.swing.MigLayout; +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + public class ActivitySummaryFrame extends JFrame { private static final long serialVersionUID = 1L; diff --git a/src/module/decode/event/ActivitySummaryProvider.java b/src/main/java/io/github/dsheirer/module/decode/event/ActivitySummaryProvider.java similarity index 88% rename from src/module/decode/event/ActivitySummaryProvider.java rename to src/main/java/io/github/dsheirer/module/decode/event/ActivitySummaryProvider.java index e113c99c..a94e7ea9 100644 --- a/src/module/decode/event/ActivitySummaryProvider.java +++ b/src/main/java/io/github/dsheirer/module/decode/event/ActivitySummaryProvider.java @@ -15,10 +15,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.event; +package io.github.dsheirer.module.decode.event; -import message.Message; -import sample.Listener; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.sample.Listener; public interface ActivitySummaryProvider extends Listener { diff --git a/src/module/decode/event/CallEvent.java b/src/main/java/io/github/dsheirer/module/decode/event/CallEvent.java similarity index 97% rename from src/module/decode/event/CallEvent.java rename to src/main/java/io/github/dsheirer/module/decode/event/CallEvent.java index a04eacc4..a0126273 100644 --- a/src/module/decode/event/CallEvent.java +++ b/src/main/java/io/github/dsheirer/module/decode/event/CallEvent.java @@ -16,11 +16,11 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.event; +package io.github.dsheirer.module.decode.event; -import alias.Alias; -import alias.AliasList; -import module.decode.DecoderType; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.module.decode.DecoderType; import java.text.SimpleDateFormat; import java.util.Date; diff --git a/src/module/decode/event/CallEventAliasCellRenderer.java b/src/main/java/io/github/dsheirer/module/decode/event/CallEventAliasCellRenderer.java similarity index 94% rename from src/module/decode/event/CallEventAliasCellRenderer.java rename to src/main/java/io/github/dsheirer/module/decode/event/CallEventAliasCellRenderer.java index 9daa9752..302d08fe 100644 --- a/src/module/decode/event/CallEventAliasCellRenderer.java +++ b/src/main/java/io/github/dsheirer/module/decode/event/CallEventAliasCellRenderer.java @@ -16,11 +16,10 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.event; +package io.github.dsheirer.module.decode.event; -import alias.Alias; -import gui.SDRTrunk; -import icon.IconManager; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.icon.IconManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/event/CallEventModel.java b/src/main/java/io/github/dsheirer/module/decode/event/CallEventModel.java similarity index 96% rename from src/module/decode/event/CallEventModel.java rename to src/main/java/io/github/dsheirer/module/decode/event/CallEventModel.java index a65d993d..93ed0fcb 100644 --- a/src/module/decode/event/CallEventModel.java +++ b/src/main/java/io/github/dsheirer/module/decode/event/CallEventModel.java @@ -15,11 +15,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.event; +package io.github.dsheirer.module.decode.event; -import alias.Alias; -import module.decode.event.CallEvent.CallEventType; -import sample.Listener; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.sample.Listener; import javax.swing.table.AbstractTableModel; import java.text.DecimalFormat; @@ -171,7 +170,7 @@ public class CallEventModel extends AbstractTableModel implements Listener * ******************************************************************************/ -package module.decode.event; +package io.github.dsheirer.module.decode.event; -import icon.IconManager; -import module.ProcessingChain; +import io.github.dsheirer.icon.IconManager; +import io.github.dsheirer.module.ProcessingChain; +import io.github.dsheirer.sample.Listener; import net.miginfocom.swing.MigLayout; -import sample.Listener; import javax.swing.*; import java.awt.*; diff --git a/src/module/decode/event/ICallEventListener.java b/src/main/java/io/github/dsheirer/module/decode/event/ICallEventListener.java similarity index 50% rename from src/module/decode/event/ICallEventListener.java rename to src/main/java/io/github/dsheirer/module/decode/event/ICallEventListener.java index f1727e2c..36d52790 100644 --- a/src/module/decode/event/ICallEventListener.java +++ b/src/main/java/io/github/dsheirer/module/decode/event/ICallEventListener.java @@ -1,6 +1,6 @@ -package module.decode.event; +package io.github.dsheirer.module.decode.event; -import sample.Listener; +import io.github.dsheirer.sample.Listener; public interface ICallEventListener { diff --git a/src/module/decode/event/ICallEventProvider.java b/src/main/java/io/github/dsheirer/module/decode/event/ICallEventProvider.java similarity index 66% rename from src/module/decode/event/ICallEventProvider.java rename to src/main/java/io/github/dsheirer/module/decode/event/ICallEventProvider.java index d4b3ae2b..bc8fc786 100644 --- a/src/module/decode/event/ICallEventProvider.java +++ b/src/main/java/io/github/dsheirer/module/decode/event/ICallEventProvider.java @@ -1,6 +1,6 @@ -package module.decode.event; +package io.github.dsheirer.module.decode.event; -import sample.Listener; +import io.github.dsheirer.sample.Listener; public interface ICallEventProvider { diff --git a/src/module/decode/event/MessageActivityModel.java b/src/main/java/io/github/dsheirer/module/decode/event/MessageActivityModel.java similarity index 95% rename from src/module/decode/event/MessageActivityModel.java rename to src/main/java/io/github/dsheirer/module/decode/event/MessageActivityModel.java index 8d419e51..d4ff0809 100644 --- a/src/module/decode/event/MessageActivityModel.java +++ b/src/main/java/io/github/dsheirer/module/decode/event/MessageActivityModel.java @@ -15,19 +15,18 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.event; +package io.github.dsheirer.module.decode.event; -import java.awt.EventQueue; +import io.github.dsheirer.filter.FilterSet; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.sample.Listener; + +import javax.swing.table.AbstractTableModel; +import java.awt.*; import java.text.SimpleDateFormat; import java.util.Date; import java.util.LinkedList; -import javax.swing.table.AbstractTableModel; - -import message.Message; -import sample.Listener; -import filter.FilterSet; - public class MessageActivityModel extends AbstractTableModel implements Listener { diff --git a/src/module/decode/event/MessageActivityPanel.java b/src/main/java/io/github/dsheirer/module/decode/event/MessageActivityPanel.java similarity index 96% rename from src/module/decode/event/MessageActivityPanel.java rename to src/main/java/io/github/dsheirer/module/decode/event/MessageActivityPanel.java index a79cefcd..7e97f17c 100644 --- a/src/module/decode/event/MessageActivityPanel.java +++ b/src/main/java/io/github/dsheirer/module/decode/event/MessageActivityPanel.java @@ -16,23 +16,19 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.event; +package io.github.dsheirer.module.decode.event; import com.jidesoft.swing.JideButton; import com.jidesoft.swing.JideSplitButton; -import controller.channel.Channel; -import controller.channel.ChannelEvent; -import controller.channel.ChannelEvent.Event; -import controller.channel.ChannelEventListener; -import controller.channel.ChannelProcessingManager; -import filter.FilterEditorPanel; -import filter.FilterSet; -import message.Message; -import module.ProcessingChain; +import io.github.dsheirer.controller.channel.ChannelProcessingManager; +import io.github.dsheirer.filter.FilterEditorPanel; +import io.github.dsheirer.filter.FilterSet; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.module.ProcessingChain; +import io.github.dsheirer.sample.Listener; import net.miginfocom.swing.MigLayout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; import javax.swing.*; import javax.swing.event.ChangeEvent; diff --git a/src/module/decode/fleetsync1/Fleetsync1Message.java b/src/main/java/io/github/dsheirer/module/decode/fleetsync1/Fleetsync1Message.java similarity index 93% rename from src/module/decode/fleetsync1/Fleetsync1Message.java rename to src/main/java/io/github/dsheirer/module/decode/fleetsync1/Fleetsync1Message.java index c3a898f7..14bccd61 100644 --- a/src/module/decode/fleetsync1/Fleetsync1Message.java +++ b/src/main/java/io/github/dsheirer/module/decode/fleetsync1/Fleetsync1Message.java @@ -15,18 +15,18 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.fleetsync1; +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 java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; -import map.Plottable; -import message.Message; -import alias.Alias; -import bits.BinaryMessage; - public class Fleetsync1Message extends Message { private static SimpleDateFormat mSDF = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" ); @@ -176,7 +176,7 @@ public class Fleetsync1Message extends Message } /** - * Provides a listing of aliases contained in the message. + * Provides a listing of aliases contained in the message. */ public List getAliases() { diff --git a/src/module/decode/fleetsync1/Fleetsync1MessageProcessor.java b/src/main/java/io/github/dsheirer/module/decode/fleetsync1/Fleetsync1MessageProcessor.java similarity index 87% rename from src/module/decode/fleetsync1/Fleetsync1MessageProcessor.java rename to src/main/java/io/github/dsheirer/module/decode/fleetsync1/Fleetsync1MessageProcessor.java index 890bdd3d..5d85f070 100644 --- a/src/module/decode/fleetsync1/Fleetsync1MessageProcessor.java +++ b/src/main/java/io/github/dsheirer/module/decode/fleetsync1/Fleetsync1MessageProcessor.java @@ -15,17 +15,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.fleetsync1; - -import message.Message; +package io.github.dsheirer.module.decode.fleetsync1; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.sample.Broadcaster; +import io.github.dsheirer.sample.Listener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Broadcaster; -import sample.Listener; -import bits.BinaryMessage; - public class Fleetsync1MessageProcessor implements Listener { private final static Logger mLog = diff --git a/src/module/decode/fleetsync2/Fleetsync2Decoder.java b/src/main/java/io/github/dsheirer/module/decode/fleetsync2/Fleetsync2Decoder.java similarity index 83% rename from src/module/decode/fleetsync2/Fleetsync2Decoder.java rename to src/main/java/io/github/dsheirer/module/decode/fleetsync2/Fleetsync2Decoder.java index 5b18628b..072d28f4 100644 --- a/src/module/decode/fleetsync2/Fleetsync2Decoder.java +++ b/src/main/java/io/github/dsheirer/module/decode/fleetsync2/Fleetsync2Decoder.java @@ -15,32 +15,31 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.fleetsync2; +package io.github.dsheirer.module.decode.fleetsync2; -import instrument.Instrumentable; -import instrument.tap.Tap; -import instrument.tap.TapGroup; -import instrument.tap.stream.BinaryTap; -import instrument.tap.stream.FloatBufferTap; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.MessageFramer; +import io.github.dsheirer.bits.SyncPattern; +import io.github.dsheirer.dsp.filter.Filters; +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.dsp.fsk.FSK2Decoder; +import io.github.dsheirer.dsp.fsk.FSK2Decoder.Output; +import io.github.dsheirer.instrument.Instrumentable; +import io.github.dsheirer.instrument.tap.Tap; +import io.github.dsheirer.instrument.tap.TapGroup; +import io.github.dsheirer.instrument.tap.stream.BinaryTap; +import io.github.dsheirer.instrument.tap.stream.FloatBufferTap; +import io.github.dsheirer.module.decode.Decoder; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.IFilteredRealBufferListener; +import io.github.dsheirer.sample.real.RealBuffer; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ScheduledExecutorService; -import module.decode.Decoder; -import module.decode.DecoderType; -import sample.Listener; -import sample.real.IFilteredRealBufferListener; -import sample.real.RealBuffer; -import alias.AliasList; -import bits.MessageFramer; -import bits.SyncPattern; -import dsp.filter.Filters; -import dsp.filter.fir.real.RealFIRFilter_RB_RB; -import dsp.filter.halfband.real.HalfBandFilter_RB_RB; -import dsp.fsk.FSK2Decoder; -import dsp.fsk.FSK2Decoder.Output; - /** * Fleetsync II Decoder - 1200 baud 2FSK decoder that can process 48k sample rate * floating point samples and output fully framed Fleetsync II messages diff --git a/src/module/decode/fleetsync2/Fleetsync2DecoderState.java b/src/main/java/io/github/dsheirer/module/decode/fleetsync2/Fleetsync2DecoderState.java similarity index 90% rename from src/module/decode/fleetsync2/Fleetsync2DecoderState.java rename to src/main/java/io/github/dsheirer/module/decode/fleetsync2/Fleetsync2DecoderState.java index e3aa69ec..0c49e560 100644 --- a/src/module/decode/fleetsync2/Fleetsync2DecoderState.java +++ b/src/main/java/io/github/dsheirer/module/decode/fleetsync2/Fleetsync2DecoderState.java @@ -16,21 +16,21 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.fleetsync2; +package io.github.dsheirer.module.decode.fleetsync2; -import alias.Alias; -import alias.AliasList; -import alias.id.AliasIDType; -import channel.metadata.AliasedStringAttributeMonitor; -import channel.metadata.Attribute; -import channel.metadata.AttributeChangeRequest; -import channel.state.DecoderState; -import channel.state.DecoderStateEvent; -import channel.state.DecoderStateEvent.Event; -import channel.state.State; -import message.Message; -import module.decode.DecoderType; -import util.StringUtils; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.alias.id.AliasIDType; +import io.github.dsheirer.channel.metadata.AliasedStringAttributeMonitor; +import io.github.dsheirer.channel.metadata.Attribute; +import io.github.dsheirer.channel.metadata.AttributeChangeRequest; +import io.github.dsheirer.channel.state.DecoderState; +import io.github.dsheirer.channel.state.DecoderStateEvent; +import io.github.dsheirer.channel.state.DecoderStateEvent.Event; +import io.github.dsheirer.channel.state.State; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.util.StringUtils; import java.util.Iterator; import java.util.TreeSet; @@ -168,7 +168,7 @@ public class Fleetsync2DecoderState extends DecoderState broadcast(fsCallEvent); - /* Broadcast decode event so that the channel state will + /* Broadcast decode event so that the channel state will * kick in and reset everything after a short delay */ broadcast(new DecoderStateEvent(this, Event.DECODE, state)); } diff --git a/src/module/decode/fleetsync2/Fleetsync2MessageProcessor.java b/src/main/java/io/github/dsheirer/module/decode/fleetsync2/Fleetsync2MessageProcessor.java similarity index 87% rename from src/module/decode/fleetsync2/Fleetsync2MessageProcessor.java rename to src/main/java/io/github/dsheirer/module/decode/fleetsync2/Fleetsync2MessageProcessor.java index 23c74653..c958b785 100644 --- a/src/module/decode/fleetsync2/Fleetsync2MessageProcessor.java +++ b/src/main/java/io/github/dsheirer/module/decode/fleetsync2/Fleetsync2MessageProcessor.java @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.fleetsync2; +package io.github.dsheirer.module.decode.fleetsync2; -import message.Message; -import sample.Listener; -import alias.AliasList; -import bits.BinaryMessage; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.sample.Listener; public class Fleetsync2MessageProcessor implements Listener { diff --git a/src/module/decode/fleetsync2/FleetsyncCallEvent.java b/src/main/java/io/github/dsheirer/module/decode/fleetsync2/FleetsyncCallEvent.java similarity index 94% rename from src/module/decode/fleetsync2/FleetsyncCallEvent.java rename to src/main/java/io/github/dsheirer/module/decode/fleetsync2/FleetsyncCallEvent.java index e60e2dc0..70fb96e7 100644 --- a/src/module/decode/fleetsync2/FleetsyncCallEvent.java +++ b/src/main/java/io/github/dsheirer/module/decode/fleetsync2/FleetsyncCallEvent.java @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.fleetsync2; +package io.github.dsheirer.module.decode.fleetsync2; -import module.decode.DecoderType; -import module.decode.event.CallEvent; -import alias.Alias; -import alias.AliasList; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.module.decode.event.CallEvent; public class FleetsyncCallEvent extends CallEvent { @@ -33,7 +33,7 @@ public class FleetsyncCallEvent extends CallEvent String details, long frequency ) { - super( DecoderType.FLEETSYNC2, callEventType, + super( DecoderType.FLEETSYNC2, callEventType, aliasList, fromID, toID, details ); mFrequency = frequency; diff --git a/src/module/decode/fleetsync2/FleetsyncMessage.java b/src/main/java/io/github/dsheirer/module/decode/fleetsync2/FleetsyncMessage.java similarity index 98% rename from src/module/decode/fleetsync2/FleetsyncMessage.java rename to src/main/java/io/github/dsheirer/module/decode/fleetsync2/FleetsyncMessage.java index 85a47cf7..206aa3fd 100644 --- a/src/module/decode/fleetsync2/FleetsyncMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/fleetsync2/FleetsyncMessage.java @@ -15,7 +15,16 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.fleetsync2; +package io.github.dsheirer.module.decode.fleetsync2; + +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRC; +import io.github.dsheirer.edac.CRCFleetsync; +import io.github.dsheirer.map.Plottable; +import io.github.dsheirer.message.Message; +import org.jdesktop.swingx.mapviewer.GeoPosition; import java.text.DecimalFormat; import java.text.SimpleDateFormat; @@ -26,17 +35,6 @@ import java.util.Date; import java.util.GregorianCalendar; import java.util.List; -import map.Plottable; -import message.Message; - -import org.jdesktop.swingx.mapviewer.GeoPosition; - -import alias.Alias; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRC; -import edac.CRCFleetsync; - public class FleetsyncMessage extends Message { private static DecimalFormat mDecimalFormatter = new DecimalFormat("#.#####"); @@ -864,7 +862,7 @@ public class FleetsyncMessage extends Message } /** - * Provides a listing of aliases contained in the message. + * Provides a listing of aliases contained in the message. */ public List getAliases() { diff --git a/src/module/decode/fleetsync2/FleetsyncMessageFilter.java b/src/main/java/io/github/dsheirer/module/decode/fleetsync2/FleetsyncMessageFilter.java similarity index 86% rename from src/module/decode/fleetsync2/FleetsyncMessageFilter.java rename to src/main/java/io/github/dsheirer/module/decode/fleetsync2/FleetsyncMessageFilter.java index a9a61c5f..fdd2f2a6 100644 --- a/src/module/decode/fleetsync2/FleetsyncMessageFilter.java +++ b/src/main/java/io/github/dsheirer/module/decode/fleetsync2/FleetsyncMessageFilter.java @@ -1,13 +1,13 @@ -package module.decode.fleetsync2; +package io.github.dsheirer.module.decode.fleetsync2; + +import io.github.dsheirer.filter.Filter; +import io.github.dsheirer.filter.FilterElement; +import io.github.dsheirer.message.Message; import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import message.Message; -import filter.Filter; -import filter.FilterElement; - public class FleetsyncMessageFilter extends Filter { private HashMap> mElements = diff --git a/src/module/decode/fleetsync2/FleetsyncMessageType.java b/src/main/java/io/github/dsheirer/module/decode/fleetsync2/FleetsyncMessageType.java similarity index 96% rename from src/module/decode/fleetsync2/FleetsyncMessageType.java rename to src/main/java/io/github/dsheirer/module/decode/fleetsync2/FleetsyncMessageType.java index 6f3730b0..275cb8ad 100644 --- a/src/module/decode/fleetsync2/FleetsyncMessageType.java +++ b/src/main/java/io/github/dsheirer/module/decode/fleetsync2/FleetsyncMessageType.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.fleetsync2; +package io.github.dsheirer.module.decode.fleetsync2; public enum FleetsyncMessageType { diff --git a/src/module/decode/lj1200/LJ1200CallEvent.java b/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200CallEvent.java similarity index 92% rename from src/module/decode/lj1200/LJ1200CallEvent.java rename to src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200CallEvent.java index 5be56feb..c90d3df1 100644 --- a/src/module/decode/lj1200/LJ1200CallEvent.java +++ b/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200CallEvent.java @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.lj1200; +package io.github.dsheirer.module.decode.lj1200; -import module.decode.DecoderType; -import module.decode.event.CallEvent; -import alias.Alias; -import alias.AliasList; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.module.decode.event.CallEvent; public class LJ1200CallEvent extends CallEvent { @@ -30,7 +30,7 @@ public class LJ1200CallEvent extends CallEvent String toID, String details ) { - super( DecoderType.LJ_1200, callEventType, + super( DecoderType.LJ_1200, callEventType, aliasList, fromID, toID, details ); } diff --git a/src/module/decode/lj1200/LJ1200Decoder.java b/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200Decoder.java similarity index 82% rename from src/module/decode/lj1200/LJ1200Decoder.java rename to src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200Decoder.java index 3e12b544..fb19a8d2 100644 --- a/src/module/decode/lj1200/LJ1200Decoder.java +++ b/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200Decoder.java @@ -15,35 +15,34 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.lj1200; +package io.github.dsheirer.module.decode.lj1200; -import instrument.Instrumentable; -import instrument.tap.Tap; -import instrument.tap.TapGroup; -import instrument.tap.stream.BinaryTap; -import instrument.tap.stream.FloatBufferTap; -import instrument.tap.stream.FloatTap; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.MessageFramer; +import io.github.dsheirer.bits.SyncPattern; +import io.github.dsheirer.dsp.filter.Filters; +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.dsp.fsk.FSK2Decoder; +import io.github.dsheirer.dsp.fsk.FSK2Decoder.Output; +import io.github.dsheirer.instrument.Instrumentable; +import io.github.dsheirer.instrument.tap.Tap; +import io.github.dsheirer.instrument.tap.TapGroup; +import io.github.dsheirer.instrument.tap.stream.BinaryTap; +import io.github.dsheirer.instrument.tap.stream.FloatBufferTap; +import io.github.dsheirer.instrument.tap.stream.FloatTap; +import io.github.dsheirer.module.decode.Decoder; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.sample.Broadcaster; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.IFilteredRealBufferListener; +import io.github.dsheirer.sample.real.RealBuffer; +import io.github.dsheirer.sample.real.RealSampleListener; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ScheduledExecutorService; -import module.decode.Decoder; -import module.decode.DecoderType; -import sample.Broadcaster; -import sample.Listener; -import sample.real.IFilteredRealBufferListener; -import sample.real.RealBuffer; -import sample.real.RealSampleListener; -import alias.AliasList; -import bits.MessageFramer; -import bits.SyncPattern; -import dsp.filter.Filters; -import dsp.filter.fir.real.RealFIRFilter_RB_RB; -import dsp.filter.halfband.real.HalfBandFilter_RB_RB; -import dsp.fsk.FSK2Decoder; -import dsp.fsk.FSK2Decoder.Output; - /** * LJ1200 - 1200 baud 2FSK decoder */ diff --git a/src/module/decode/lj1200/LJ1200DecoderState.java b/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200DecoderState.java similarity index 85% rename from src/module/decode/lj1200/LJ1200DecoderState.java rename to src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200DecoderState.java index 5382f034..c4154dc5 100644 --- a/src/module/decode/lj1200/LJ1200DecoderState.java +++ b/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200DecoderState.java @@ -16,23 +16,20 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.lj1200; +package io.github.dsheirer.module.decode.lj1200; -import alias.Alias; -import alias.AliasList; -import alias.id.AliasIDType; -import channel.metadata.AliasedStringAttributeMonitor; -import channel.metadata.Attribute; -import channel.metadata.AttributeChangeRequest; -import channel.state.DecoderState; -import channel.state.DecoderStateEvent; -import channel.state.DecoderStateEvent.Event; -import channel.state.State; -import message.Message; -import module.decode.DecoderType; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.alias.id.AliasIDType; +import io.github.dsheirer.channel.metadata.AliasedStringAttributeMonitor; +import io.github.dsheirer.channel.metadata.Attribute; +import io.github.dsheirer.channel.state.DecoderState; +import io.github.dsheirer.channel.state.DecoderStateEvent; +import io.github.dsheirer.channel.state.DecoderStateEvent.Event; +import io.github.dsheirer.channel.state.State; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.module.decode.DecoderType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import util.StringUtils; import java.util.ArrayList; import java.util.Collections; diff --git a/src/module/decode/lj1200/LJ1200Message.java b/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200Message.java similarity index 95% rename from src/module/decode/lj1200/LJ1200Message.java rename to src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200Message.java index 64bc8ca3..962d1a82 100644 --- a/src/module/decode/lj1200/LJ1200Message.java +++ b/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200Message.java @@ -15,22 +15,20 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.lj1200; - -import java.util.ArrayList; -import java.util.List; - -import map.Plottable; -import message.Message; +package io.github.dsheirer.module.decode.lj1200; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRC; +import io.github.dsheirer.edac.CRCLJ; +import io.github.dsheirer.map.Plottable; +import io.github.dsheirer.message.Message; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import alias.Alias; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRC; -import edac.CRCLJ; +import java.util.ArrayList; +import java.util.List; public class LJ1200Message extends Message { @@ -396,7 +394,7 @@ public class LJ1200Message extends Message } /** - * Provides a listing of aliases contained in the message. + * Provides a listing of aliases contained in the message. */ public List getAliases() { diff --git a/src/module/decode/lj1200/LJ1200MessageFilter.java b/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200MessageFilter.java similarity index 89% rename from src/module/decode/lj1200/LJ1200MessageFilter.java rename to src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200MessageFilter.java index 7f6257d7..64faf7c9 100644 --- a/src/module/decode/lj1200/LJ1200MessageFilter.java +++ b/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200MessageFilter.java @@ -15,15 +15,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.lj1200; +package io.github.dsheirer.module.decode.lj1200; + +import io.github.dsheirer.filter.Filter; +import io.github.dsheirer.filter.FilterElement; +import io.github.dsheirer.message.Message; import java.util.Collections; import java.util.List; -import message.Message; -import filter.Filter; -import filter.FilterElement; - public class LJ1200MessageFilter extends Filter { diff --git a/src/module/decode/lj1200/LJ1200MessageProcessor.java b/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200MessageProcessor.java similarity index 90% rename from src/module/decode/lj1200/LJ1200MessageProcessor.java rename to src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200MessageProcessor.java index fc11279c..4b212b5e 100644 --- a/src/module/decode/lj1200/LJ1200MessageProcessor.java +++ b/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200MessageProcessor.java @@ -15,17 +15,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.lj1200; - -import message.Message; +package io.github.dsheirer.module.decode.lj1200; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.sample.Listener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; -import alias.AliasList; -import bits.BinaryMessage; - public class LJ1200MessageProcessor implements Listener { private final static Logger mLog = diff --git a/src/module/decode/lj1200/LJ1200TransponderMessage.java b/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200TransponderMessage.java similarity index 93% rename from src/module/decode/lj1200/LJ1200TransponderMessage.java rename to src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200TransponderMessage.java index 5400cabc..2ebd0b70 100644 --- a/src/module/decode/lj1200/LJ1200TransponderMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200TransponderMessage.java @@ -15,20 +15,18 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.lj1200; - -import java.text.SimpleDateFormat; - -import map.Plottable; -import message.Message; +package io.github.dsheirer.module.decode.lj1200; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRC; +import io.github.dsheirer.map.Plottable; +import io.github.dsheirer.message.Message; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import alias.Alias; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRC; +import java.text.SimpleDateFormat; public class LJ1200TransponderMessage extends Message { diff --git a/src/module/decode/ltrnet/DecodeConfigLTRNet.java b/src/main/java/io/github/dsheirer/module/decode/ltrnet/DecodeConfigLTRNet.java similarity index 52% rename from src/module/decode/ltrnet/DecodeConfigLTRNet.java rename to src/main/java/io/github/dsheirer/module/decode/ltrnet/DecodeConfigLTRNet.java index 574785b5..2e119ae9 100644 --- a/src/module/decode/ltrnet/DecodeConfigLTRNet.java +++ b/src/main/java/io/github/dsheirer/module/decode/ltrnet/DecodeConfigLTRNet.java @@ -1,45 +1,49 @@ /******************************************************************************* * 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 ******************************************************************************/ -package module.decode.ltrnet; +package io.github.dsheirer.module.decode.ltrnet; -import javax.xml.bind.annotation.XmlAttribute; - -import message.MessageDirection; -import module.decode.DecoderType; -import module.decode.config.DecodeConfiguration; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.github.dsheirer.message.MessageDirection; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.module.decode.config.DecodeConfiguration; public class DecodeConfigLTRNet extends DecodeConfiguration { - private MessageDirection mMessageDirection = MessageDirection.OSW; - - public DecodeConfigLTRNet() + private MessageDirection mMessageDirection = MessageDirection.OSW; + + public DecodeConfigLTRNet() { - super( DecoderType.LTR_NET ); } - @XmlAttribute( name = "direction" ) - public MessageDirection getMessageDirection() - { - return mMessageDirection; - } - - public void setMessageDirection( MessageDirection direction ) - { - mMessageDirection = direction; - } + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + public DecoderType getDecoderType() + { + return DecoderType.LTR_NET; + } + + @JacksonXmlProperty(isAttribute = true, localName = "direction") + public MessageDirection getMessageDirection() + { + return mMessageDirection; + } + + public void setMessageDirection(MessageDirection direction) + { + mMessageDirection = direction; + } } diff --git a/src/module/decode/ltrnet/LTRCallEvent.java b/src/main/java/io/github/dsheirer/module/decode/ltrnet/LTRCallEvent.java similarity index 94% rename from src/module/decode/ltrnet/LTRCallEvent.java rename to src/main/java/io/github/dsheirer/module/decode/ltrnet/LTRCallEvent.java index 671d7c2a..6ff1d189 100644 --- a/src/module/decode/ltrnet/LTRCallEvent.java +++ b/src/main/java/io/github/dsheirer/module/decode/ltrnet/LTRCallEvent.java @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.ltrnet; +package io.github.dsheirer.module.decode.ltrnet; -import module.decode.DecoderType; -import module.decode.event.CallEvent; -import alias.Alias; -import alias.AliasList; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.module.decode.event.CallEvent; public class LTRCallEvent extends CallEvent { @@ -67,7 +67,7 @@ public class LTRCallEvent extends CallEvent return talkgroup != null && getToID() != null && talkgroup.contentEquals( getToID() ); } - private Alias getAlias( String talkgroup ) + private Alias getAlias(String talkgroup ) { if( hasAliasList() ) { diff --git a/src/module/decode/ltrnet/LTRNetDecoder.java b/src/main/java/io/github/dsheirer/module/decode/ltrnet/LTRNetDecoder.java similarity index 80% rename from src/module/decode/ltrnet/LTRNetDecoder.java rename to src/main/java/io/github/dsheirer/module/decode/ltrnet/LTRNetDecoder.java index 5e1eecff..08041b72 100644 --- a/src/module/decode/ltrnet/LTRNetDecoder.java +++ b/src/main/java/io/github/dsheirer/module/decode/ltrnet/LTRNetDecoder.java @@ -15,28 +15,27 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.ltrnet; +package io.github.dsheirer.module.decode.ltrnet; -import instrument.Instrumentable; -import instrument.tap.Tap; -import instrument.tap.TapGroup; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.MessageFramer; +import io.github.dsheirer.bits.SyncPattern; +import io.github.dsheirer.dsp.fsk.LTRFSKDecoder; +import io.github.dsheirer.instrument.Instrumentable; +import io.github.dsheirer.instrument.tap.Tap; +import io.github.dsheirer.instrument.tap.TapGroup; +import io.github.dsheirer.message.MessageDirection; +import io.github.dsheirer.module.decode.Decoder; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.IUnFilteredRealBufferListener; +import io.github.dsheirer.sample.real.RealBuffer; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ScheduledExecutorService; -import message.MessageDirection; -import module.decode.Decoder; -import module.decode.DecoderType; -import sample.Listener; -import sample.real.IUnFilteredRealBufferListener; -import sample.real.RealBuffer; -import alias.AliasList; -import bits.MessageFramer; -import bits.SyncPattern; -import dsp.fsk.LTRFSKDecoder; - -public class LTRNetDecoder extends Decoder +public class LTRNetDecoder extends Decoder implements IUnFilteredRealBufferListener, Instrumentable { public static final int LTR_STANDARD_MESSAGE_LENGTH = 40; diff --git a/src/module/decode/ltrnet/LTRNetDecoderEditor.java b/src/main/java/io/github/dsheirer/module/decode/ltrnet/LTRNetDecoderEditor.java similarity index 92% rename from src/module/decode/ltrnet/LTRNetDecoderEditor.java rename to src/main/java/io/github/dsheirer/module/decode/ltrnet/LTRNetDecoderEditor.java index 1913412d..945a35b5 100644 --- a/src/module/decode/ltrnet/LTRNetDecoderEditor.java +++ b/src/main/java/io/github/dsheirer/module/decode/ltrnet/LTRNetDecoderEditor.java @@ -15,27 +15,21 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.ltrnet; +package io.github.dsheirer.module.decode.ltrnet; -import gui.editor.Editor; -import gui.editor.EditorValidationException; -import gui.editor.ValidatingEditor; +import io.github.dsheirer.controller.channel.Channel; +import io.github.dsheirer.gui.editor.Editor; +import io.github.dsheirer.gui.editor.EditorValidationException; +import io.github.dsheirer.gui.editor.ValidatingEditor; +import io.github.dsheirer.message.MessageDirection; +import io.github.dsheirer.module.decode.config.DecodeConfiguration; +import net.miginfocom.swing.MigLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.DefaultComboBoxModel; -import javax.swing.JCheckBox; -import javax.swing.JComboBox; -import javax.swing.JLabel; -import javax.swing.JSlider; +import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; - -import message.MessageDirection; -import module.decode.config.DecodeConfiguration; -import net.miginfocom.swing.MigLayout; -import controller.channel.Channel; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; public class LTRNetDecoderEditor extends ValidatingEditor { diff --git a/src/module/decode/ltrnet/LTRNetDecoderState.java b/src/main/java/io/github/dsheirer/module/decode/ltrnet/LTRNetDecoderState.java similarity index 94% rename from src/module/decode/ltrnet/LTRNetDecoderState.java rename to src/main/java/io/github/dsheirer/module/decode/ltrnet/LTRNetDecoderState.java index e643b558..48c3b3ef 100644 --- a/src/module/decode/ltrnet/LTRNetDecoderState.java +++ b/src/main/java/io/github/dsheirer/module/decode/ltrnet/LTRNetDecoderState.java @@ -15,26 +15,25 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.ltrnet; +package io.github.dsheirer.module.decode.ltrnet; -import alias.Alias; -import alias.AliasList; -import alias.id.AliasIDType; -import channel.metadata.AliasedIntegerAttributeMonitor; -import channel.metadata.AliasedStringAttributeMonitor; -import channel.metadata.Attribute; -import channel.metadata.AttributeChangeRequest; -import channel.state.DecoderState; -import channel.state.DecoderStateEvent; -import channel.state.DecoderStateEvent.Event; -import channel.state.State; -import message.Message; -import module.decode.DecoderType; -import module.decode.event.CallEvent; -import module.decode.event.CallEvent.CallEventType; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.alias.id.AliasIDType; +import io.github.dsheirer.channel.metadata.AliasedIntegerAttributeMonitor; +import io.github.dsheirer.channel.metadata.AliasedStringAttributeMonitor; +import io.github.dsheirer.channel.metadata.Attribute; +import io.github.dsheirer.channel.metadata.AttributeChangeRequest; +import io.github.dsheirer.channel.state.DecoderState; +import io.github.dsheirer.channel.state.DecoderStateEvent; +import io.github.dsheirer.channel.state.DecoderStateEvent.Event; +import io.github.dsheirer.channel.state.State; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.module.decode.event.CallEvent; +import io.github.dsheirer.util.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import util.StringUtils; import java.text.DecimalFormat; import java.util.HashMap; @@ -113,10 +112,10 @@ public class LTRNetDecoderState extends DecoderState { if(mCurrentCallEvent == null || mCurrentCallEvent.getCallEventType() != - CallEventType.STATION_ID) + CallEvent.CallEventType.STATION_ID) { mCurrentCallEvent = new LTRCallEvent.Builder( - DecoderType.LTR_NET, CallEventType.STATION_ID) + DecoderType.LTR_NET, CallEvent.CallEventType.STATION_ID) .aliasList(getAliasList()) .channel(String.valueOf(mChannelNumber)) .frequency(mFrequency) @@ -200,7 +199,7 @@ public class LTRNetDecoderState extends DecoderState if(getCurrentLTRCallEvent() == null) { mCurrentCallEvent = new LTRCallEvent.Builder( - DecoderType.LTR_NET, CallEventType.REGISTER) + DecoderType.LTR_NET, CallEvent.CallEventType.REGISTER) .aliasList(getAliasList()) .channel(String.valueOf(mChannelNumber)) .frequency(mFrequency) @@ -261,7 +260,7 @@ public class LTRNetDecoderState extends DecoderState if(mCurrentCallEvent == null) { mCurrentCallEvent = new LTRCallEvent.Builder( - DecoderType.LTR_NET, CallEventType.REGISTER_ESN) + DecoderType.LTR_NET, CallEvent.CallEventType.REGISTER_ESN) .aliasList(getAliasList()) .details("ESN:" + ltr.getESN()) .frequency(mFrequency) @@ -287,7 +286,7 @@ public class LTRNetDecoderState extends DecoderState if(getCurrentLTRCallEvent() == null) { mCurrentCallEvent = new LTRCallEvent.Builder( - DecoderType.LTR_NET, CallEventType.REGISTER) + DecoderType.LTR_NET, CallEvent.CallEventType.REGISTER) .aliasList(getAliasList()) .channel(String.valueOf(mChannelNumber)) .frequency(mFrequency) @@ -573,7 +572,7 @@ public class LTRNetDecoderState extends DecoderState frequency = mTransmitFrequencies.get(channel); } - broadcast(new LTRCallEvent.Builder(DecoderType.LTR_NET, CallEventType.CALL_DETECT) + broadcast(new LTRCallEvent.Builder(DecoderType.LTR_NET, CallEvent.CallEventType.CALL_DETECT) .aliasList(getAliasList()) .channel(String.valueOf(message.getChannel())) .frequency(frequency) @@ -644,7 +643,7 @@ public class LTRNetDecoderState extends DecoderState mTalkgroupsFirstHeard.add(talkgroup); } - CallEvent callEvent = new LTRCallEvent.Builder(DecoderType.LTR_NET, CallEventType.CALL) + CallEvent callEvent = new LTRCallEvent.Builder(DecoderType.LTR_NET, CallEvent.CallEventType.CALL) .aliasList(getAliasList()) .channel(String.valueOf(message.getChannel())) .frequency(mFrequency) @@ -666,7 +665,7 @@ public class LTRNetDecoderState extends DecoderState private void processCallEndMessage(LTRNetMessage message) { if(mCurrentCallEvent != null && - mCurrentCallEvent.getCallEventType() == CallEventType.CALL) + mCurrentCallEvent.getCallEventType() == CallEvent.CallEventType.CALL) { mCurrentCallEvent.setEnd(System.currentTimeMillis()); broadcast(mCurrentCallEvent); @@ -702,7 +701,7 @@ public class LTRNetDecoderState extends DecoderState private void resetState() { if(mCurrentCallEvent != null && mCurrentCallEvent - .getCallEventType() == CallEventType.CALL) + .getCallEventType() == CallEvent.CallEventType.CALL) { mCurrentCallEvent.end(); broadcast(mCurrentCallEvent); diff --git a/src/module/decode/ltrnet/LTRNetISWMessage.java b/src/main/java/io/github/dsheirer/module/decode/ltrnet/LTRNetISWMessage.java similarity index 94% rename from src/module/decode/ltrnet/LTRNetISWMessage.java rename to src/main/java/io/github/dsheirer/module/decode/ltrnet/LTRNetISWMessage.java index 2567b5d1..0f0b6c19 100644 --- a/src/module/decode/ltrnet/LTRNetISWMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/ltrnet/LTRNetISWMessage.java @@ -15,21 +15,21 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.ltrnet; +package io.github.dsheirer.module.decode.ltrnet; + +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRC; +import io.github.dsheirer.edac.CRCLTR; +import io.github.dsheirer.map.Plottable; +import io.github.dsheirer.message.MessageDirection; +import io.github.dsheirer.message.MessageType; import java.util.ArrayList; import java.util.Date; import java.util.List; -import map.Plottable; -import message.MessageDirection; -import message.MessageType; -import alias.Alias; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRC; -import edac.CRCLTR; - public class LTRNetISWMessage extends LTRNetMessage { private static final int sCHIU_UNIQUE_ID = 24; @@ -313,7 +313,7 @@ public class LTRNetISWMessage extends LTRNetMessage } /** - * Provides a listing of aliases contained in the message. + * Provides a listing of aliases contained in the message. */ public List getAliases() { diff --git a/src/module/decode/ltrnet/LTRNetMessage.java b/src/main/java/io/github/dsheirer/module/decode/ltrnet/LTRNetMessage.java similarity index 92% rename from src/module/decode/ltrnet/LTRNetMessage.java rename to src/main/java/io/github/dsheirer/module/decode/ltrnet/LTRNetMessage.java index 75d3d468..4973229f 100644 --- a/src/module/decode/ltrnet/LTRNetMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/ltrnet/LTRNetMessage.java @@ -15,21 +15,21 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.ltrnet; +package io.github.dsheirer.module.decode.ltrnet; + +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRC; +import io.github.dsheirer.edac.CRCLTR; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.message.MessageDirection; +import io.github.dsheirer.message.MessageType; +import io.github.dsheirer.module.decode.DecoderType; import java.text.DecimalFormat; import java.text.SimpleDateFormat; -import message.Message; -import message.MessageDirection; -import message.MessageType; -import module.decode.DecoderType; -import alias.Alias; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRC; -import edac.CRCLTR; - public abstract class LTRNetMessage extends Message { protected static final String sUNKNOWN = "**UNKNOWN**"; diff --git a/src/module/decode/ltrnet/LTRNetMessageFilter.java b/src/main/java/io/github/dsheirer/module/decode/ltrnet/LTRNetMessageFilter.java similarity index 91% rename from src/module/decode/ltrnet/LTRNetMessageFilter.java rename to src/main/java/io/github/dsheirer/module/decode/ltrnet/LTRNetMessageFilter.java index 3d73884b..2a064cb3 100644 --- a/src/module/decode/ltrnet/LTRNetMessageFilter.java +++ b/src/main/java/io/github/dsheirer/module/decode/ltrnet/LTRNetMessageFilter.java @@ -1,14 +1,14 @@ -package module.decode.ltrnet; +package io.github.dsheirer.module.decode.ltrnet; + +import io.github.dsheirer.filter.Filter; +import io.github.dsheirer.filter.FilterElement; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.message.MessageType; import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import message.Message; -import message.MessageType; -import filter.Filter; -import filter.FilterElement; - public class LTRNetMessageFilter extends Filter { private HashMap> mElements = diff --git a/src/module/decode/ltrnet/LTRNetMessageProcessor.java b/src/main/java/io/github/dsheirer/module/decode/ltrnet/LTRNetMessageProcessor.java similarity index 87% rename from src/module/decode/ltrnet/LTRNetMessageProcessor.java rename to src/main/java/io/github/dsheirer/module/decode/ltrnet/LTRNetMessageProcessor.java index bd7aa512..b40268cf 100644 --- a/src/module/decode/ltrnet/LTRNetMessageProcessor.java +++ b/src/main/java/io/github/dsheirer/module/decode/ltrnet/LTRNetMessageProcessor.java @@ -15,17 +15,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.ltrnet; +package io.github.dsheirer.module.decode.ltrnet; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.message.MessageDirection; +import io.github.dsheirer.message.MessageType; +import io.github.dsheirer.sample.Listener; import java.util.HashMap; -import message.Message; -import message.MessageDirection; -import message.MessageType; -import sample.Listener; -import alias.AliasList; -import bits.BinaryMessage; - public class LTRNetMessageProcessor implements Listener { private Listener mMessageListener; @@ -46,8 +46,7 @@ public class LTRNetMessageProcessor implements Listener private MessageDirection mDirection; private AliasList mAliasList; - public LTRNetMessageProcessor( MessageDirection direction, - AliasList list ) + public LTRNetMessageProcessor( MessageDirection direction, AliasList list ) { mDirection = direction; mAliasList = list; @@ -68,11 +67,9 @@ public class LTRNetMessageProcessor implements Listener { if( message.getMessageType() == MessageType.FQ_TXHI ) { - mTransmitHighAuxMessages.put( message.getHomeRepeater(), - (LTRNetOSWMessage)message ); + mTransmitHighAuxMessages.put( message.getHomeRepeater(), (LTRNetOSWMessage)message ); - message.setAuxiliaryMessage( mTransmitLowAuxMessages.get( - message.getHomeRepeater() ) ); + message.setAuxiliaryMessage( mTransmitLowAuxMessages.get(message.getHomeRepeater() ) ); } else if( message.getMessageType() == MessageType.FQ_TXLO ) { @@ -118,7 +115,7 @@ public class LTRNetMessageProcessor implements Listener if( mESNLowMessage != null ) { - /* Check that the stored message is not older than + /* Check that the stored message is not older than * 5 seconds */ if( System.currentTimeMillis() - mESNLowMessage.getTimeReceived() < 5000 ) diff --git a/src/module/decode/ltrnet/LTRNetOSWMessage.java b/src/main/java/io/github/dsheirer/module/decode/ltrnet/LTRNetOSWMessage.java similarity index 97% rename from src/module/decode/ltrnet/LTRNetOSWMessage.java rename to src/main/java/io/github/dsheirer/module/decode/ltrnet/LTRNetOSWMessage.java index 5e90fd99..89368985 100644 --- a/src/module/decode/ltrnet/LTRNetOSWMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/ltrnet/LTRNetOSWMessage.java @@ -15,19 +15,19 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.ltrnet; +package io.github.dsheirer.module.decode.ltrnet; + +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.map.Plottable; +import io.github.dsheirer.message.MessageDirection; +import io.github.dsheirer.message.MessageType; import java.util.ArrayList; import java.util.Date; import java.util.List; -import map.Plottable; -import message.MessageDirection; -import message.MessageType; -import alias.Alias; -import alias.AliasList; -import bits.BinaryMessage; - public class LTRNetOSWMessage extends LTRNetMessage { private static final int CHANNEL_FREQUENCY_MESSAGE_TYPE_BIT = 20; @@ -598,7 +598,7 @@ public class LTRNetOSWMessage extends LTRNetMessage } /** - * Provides a listing of aliases contained in the message. + * Provides a listing of aliases contained in the message. */ public List getAliases() { diff --git a/src/module/decode/ltrstandard/DecodeConfigLTRStandard.java b/src/main/java/io/github/dsheirer/module/decode/ltrstandard/DecodeConfigLTRStandard.java similarity index 51% rename from src/module/decode/ltrstandard/DecodeConfigLTRStandard.java rename to src/main/java/io/github/dsheirer/module/decode/ltrstandard/DecodeConfigLTRStandard.java index 702ceff1..556816a2 100644 --- a/src/module/decode/ltrstandard/DecodeConfigLTRStandard.java +++ b/src/main/java/io/github/dsheirer/module/decode/ltrstandard/DecodeConfigLTRStandard.java @@ -1,45 +1,50 @@ /******************************************************************************* * 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 ******************************************************************************/ -package module.decode.ltrstandard; +package io.github.dsheirer.module.decode.ltrstandard; -import javax.xml.bind.annotation.XmlAttribute; - -import message.MessageDirection; -import module.decode.DecoderType; -import module.decode.config.DecodeConfiguration; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.github.dsheirer.message.MessageDirection; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.module.decode.config.DecodeConfiguration; public class DecodeConfigLTRStandard extends DecodeConfiguration { - private MessageDirection mMessageDirection = MessageDirection.OSW; + private MessageDirection mMessageDirection = MessageDirection.OSW; - public DecodeConfigLTRStandard() + public DecodeConfigLTRStandard() { - super( DecoderType.LTR_STANDARD ); } - @XmlAttribute( name = "direction" ) - public MessageDirection getMessageDirection() - { - return mMessageDirection; - } - - public void setMessageDirection( MessageDirection direction ) - { - mMessageDirection = direction; - } + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + public DecoderType getDecoderType() + { + return DecoderType.LTR_STANDARD; + } + + + @JacksonXmlProperty(isAttribute = false, localName = "direction") + public MessageDirection getMessageDirection() + { + return mMessageDirection; + } + + public void setMessageDirection(MessageDirection direction) + { + mMessageDirection = direction; + } } diff --git a/src/module/decode/ltrstandard/LTRStandardDecoder.java b/src/main/java/io/github/dsheirer/module/decode/ltrstandard/LTRStandardDecoder.java similarity index 82% rename from src/module/decode/ltrstandard/LTRStandardDecoder.java rename to src/main/java/io/github/dsheirer/module/decode/ltrstandard/LTRStandardDecoder.java index 06f0a927..0a96486b 100644 --- a/src/module/decode/ltrstandard/LTRStandardDecoder.java +++ b/src/main/java/io/github/dsheirer/module/decode/ltrstandard/LTRStandardDecoder.java @@ -15,21 +15,21 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.ltrstandard; +package io.github.dsheirer.module.decode.ltrstandard; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.MessageFramer; +import io.github.dsheirer.bits.SyncPattern; +import io.github.dsheirer.dsp.fsk.LTRFSKDecoder; +import io.github.dsheirer.message.MessageDirection; +import io.github.dsheirer.module.decode.Decoder; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.IUnFilteredRealBufferListener; +import io.github.dsheirer.sample.real.RealBuffer; import java.util.concurrent.ScheduledExecutorService; -import message.MessageDirection; -import module.decode.Decoder; -import module.decode.DecoderType; -import sample.Listener; -import sample.real.IUnFilteredRealBufferListener; -import sample.real.RealBuffer; -import alias.AliasList; -import bits.MessageFramer; -import bits.SyncPattern; -import dsp.fsk.LTRFSKDecoder; - public class LTRStandardDecoder extends Decoder implements IUnFilteredRealBufferListener { public static final int LTR_STANDARD_MESSAGE_LENGTH = 40; diff --git a/src/module/decode/ltrstandard/LTRStandardDecoderEditor.java b/src/main/java/io/github/dsheirer/module/decode/ltrstandard/LTRStandardDecoderEditor.java similarity index 92% rename from src/module/decode/ltrstandard/LTRStandardDecoderEditor.java rename to src/main/java/io/github/dsheirer/module/decode/ltrstandard/LTRStandardDecoderEditor.java index 3e247d4f..e3a9bfca 100644 --- a/src/module/decode/ltrstandard/LTRStandardDecoderEditor.java +++ b/src/main/java/io/github/dsheirer/module/decode/ltrstandard/LTRStandardDecoderEditor.java @@ -15,27 +15,21 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.ltrstandard; +package io.github.dsheirer.module.decode.ltrstandard; -import gui.editor.Editor; -import gui.editor.EditorValidationException; -import gui.editor.ValidatingEditor; +import io.github.dsheirer.controller.channel.Channel; +import io.github.dsheirer.gui.editor.Editor; +import io.github.dsheirer.gui.editor.EditorValidationException; +import io.github.dsheirer.gui.editor.ValidatingEditor; +import io.github.dsheirer.message.MessageDirection; +import io.github.dsheirer.module.decode.config.DecodeConfiguration; +import net.miginfocom.swing.MigLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.DefaultComboBoxModel; -import javax.swing.JCheckBox; -import javax.swing.JComboBox; -import javax.swing.JLabel; -import javax.swing.JSlider; +import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; - -import message.MessageDirection; -import module.decode.config.DecodeConfiguration; -import net.miginfocom.swing.MigLayout; -import controller.channel.Channel; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; public class LTRStandardDecoderEditor extends ValidatingEditor { diff --git a/src/module/decode/ltrstandard/LTRStandardDecoderState.java b/src/main/java/io/github/dsheirer/module/decode/ltrstandard/LTRStandardDecoderState.java similarity index 91% rename from src/module/decode/ltrstandard/LTRStandardDecoderState.java rename to src/main/java/io/github/dsheirer/module/decode/ltrstandard/LTRStandardDecoderState.java index a826ceeb..788c8d9b 100644 --- a/src/module/decode/ltrstandard/LTRStandardDecoderState.java +++ b/src/main/java/io/github/dsheirer/module/decode/ltrstandard/LTRStandardDecoderState.java @@ -16,29 +16,28 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.ltrstandard; +package io.github.dsheirer.module.decode.ltrstandard; -import alias.Alias; -import alias.AliasList; -import alias.id.AliasIDType; -import channel.metadata.AliasedStringAttributeMonitor; -import channel.metadata.Attribute; -import channel.metadata.AttributeChangeRequest; -import channel.state.DecoderState; -import channel.state.DecoderStateEvent; -import channel.state.DecoderStateEvent.Event; -import channel.state.State; -import message.Message; -import module.decode.DecoderType; -import module.decode.event.CallEvent.CallEventType; -import module.decode.ltrnet.LTRCallEvent; -import module.decode.ltrstandard.message.CallEndMessage; -import module.decode.ltrstandard.message.CallMessage; -import module.decode.ltrstandard.message.IdleMessage; -import module.decode.ltrstandard.message.LTRStandardMessage; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.alias.id.AliasIDType; +import io.github.dsheirer.channel.metadata.AliasedStringAttributeMonitor; +import io.github.dsheirer.channel.metadata.Attribute; +import io.github.dsheirer.channel.metadata.AttributeChangeRequest; +import io.github.dsheirer.channel.state.DecoderState; +import io.github.dsheirer.channel.state.DecoderStateEvent; +import io.github.dsheirer.channel.state.DecoderStateEvent.Event; +import io.github.dsheirer.channel.state.State; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.module.decode.event.CallEvent; +import io.github.dsheirer.module.decode.ltrnet.LTRCallEvent; +import io.github.dsheirer.module.decode.ltrstandard.message.CallEndMessage; +import io.github.dsheirer.module.decode.ltrstandard.message.CallMessage; +import io.github.dsheirer.module.decode.ltrstandard.message.IdleMessage; +import io.github.dsheirer.module.decode.ltrstandard.message.LTRStandardMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import util.StringUtils; import java.util.ArrayList; import java.util.HashMap; @@ -125,7 +124,7 @@ public class LTRStandardDecoderState extends DecoderState event = new LTRCallEvent.Builder( DecoderType.LTR_STANDARD, - current ? CallEventType.CALL : CallEventType.CALL_DETECT) + current ? CallEvent.CallEventType.CALL : CallEvent.CallEventType.CALL_DETECT) .to(start.getToID()) .aliasList(getAliasList()) .channel(start.getChannelFormatted()) diff --git a/src/module/decode/ltrstandard/LTRStandardMessageFilter.java b/src/main/java/io/github/dsheirer/module/decode/ltrstandard/LTRStandardMessageFilter.java similarity index 80% rename from src/module/decode/ltrstandard/LTRStandardMessageFilter.java rename to src/main/java/io/github/dsheirer/module/decode/ltrstandard/LTRStandardMessageFilter.java index 03bc3065..c1d9c5ad 100644 --- a/src/module/decode/ltrstandard/LTRStandardMessageFilter.java +++ b/src/main/java/io/github/dsheirer/module/decode/ltrstandard/LTRStandardMessageFilter.java @@ -1,15 +1,15 @@ -package module.decode.ltrstandard; +package io.github.dsheirer.module.decode.ltrstandard; + +import io.github.dsheirer.filter.Filter; +import io.github.dsheirer.filter.FilterElement; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.message.MessageType; +import io.github.dsheirer.module.decode.ltrstandard.message.LTRStandardMessage; import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import message.Message; -import message.MessageType; -import module.decode.ltrstandard.message.LTRStandardMessage; -import filter.Filter; -import filter.FilterElement; - public class LTRStandardMessageFilter extends Filter { private HashMap> mElements = diff --git a/src/module/decode/ltrstandard/LTRStandardMessageProcessor.java b/src/main/java/io/github/dsheirer/module/decode/ltrstandard/LTRStandardMessageProcessor.java similarity index 81% rename from src/module/decode/ltrstandard/LTRStandardMessageProcessor.java rename to src/main/java/io/github/dsheirer/module/decode/ltrstandard/LTRStandardMessageProcessor.java index cb5c5c8e..ccf7eb59 100644 --- a/src/module/decode/ltrstandard/LTRStandardMessageProcessor.java +++ b/src/main/java/io/github/dsheirer/module/decode/ltrstandard/LTRStandardMessageProcessor.java @@ -15,20 +15,20 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.ltrstandard; +package io.github.dsheirer.module.decode.ltrstandard; -import message.Message; -import message.MessageDirection; -import module.decode.ltrstandard.message.CallEndMessage; -import module.decode.ltrstandard.message.CallMessage; -import module.decode.ltrstandard.message.IdleMessage; -import module.decode.ltrstandard.message.LTRStandardMessage; -import module.decode.ltrstandard.message.UnknownMessage; -import sample.Listener; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRC; -import edac.CRCLTR; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRC; +import io.github.dsheirer.edac.CRCLTR; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.message.MessageDirection; +import io.github.dsheirer.module.decode.ltrstandard.message.CallEndMessage; +import io.github.dsheirer.module.decode.ltrstandard.message.CallMessage; +import io.github.dsheirer.module.decode.ltrstandard.message.IdleMessage; +import io.github.dsheirer.module.decode.ltrstandard.message.LTRStandardMessage; +import io.github.dsheirer.module.decode.ltrstandard.message.UnknownMessage; +import io.github.dsheirer.sample.Listener; public class LTRStandardMessageProcessor implements Listener { diff --git a/src/module/decode/ltrstandard/message/CallEndMessage.java b/src/main/java/io/github/dsheirer/module/decode/ltrstandard/message/CallEndMessage.java similarity index 79% rename from src/module/decode/ltrstandard/message/CallEndMessage.java rename to src/main/java/io/github/dsheirer/module/decode/ltrstandard/message/CallEndMessage.java index 24f89333..646f795b 100644 --- a/src/module/decode/ltrstandard/message/CallEndMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/ltrstandard/message/CallEndMessage.java @@ -15,19 +15,19 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.ltrstandard.message; +package io.github.dsheirer.module.decode.ltrstandard.message; -import message.MessageDirection; -import message.MessageType; -import alias.Alias; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRC; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRC; +import io.github.dsheirer.message.MessageDirection; +import io.github.dsheirer.message.MessageType; public class CallEndMessage extends LTRStandardMessage { - public CallEndMessage( BinaryMessage message, MessageDirection direction, - AliasList list, CRC crc ) + public CallEndMessage(BinaryMessage message, MessageDirection direction, + AliasList list, CRC crc ) { super( message, direction, list, crc ); } diff --git a/src/module/decode/ltrstandard/message/CallMessage.java b/src/main/java/io/github/dsheirer/module/decode/ltrstandard/message/CallMessage.java similarity index 79% rename from src/module/decode/ltrstandard/message/CallMessage.java rename to src/main/java/io/github/dsheirer/module/decode/ltrstandard/message/CallMessage.java index 8d7e5071..07f949b5 100644 --- a/src/module/decode/ltrstandard/message/CallMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/ltrstandard/message/CallMessage.java @@ -15,19 +15,18 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.ltrstandard.message; +package io.github.dsheirer.module.decode.ltrstandard.message; -import message.MessageDirection; -import message.MessageType; -import alias.Alias; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRC; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRC; +import io.github.dsheirer.message.MessageDirection; +import io.github.dsheirer.message.MessageType; public class CallMessage extends LTRStandardMessage { - public CallMessage( BinaryMessage message, MessageDirection direction, - AliasList list, CRC crc ) + public CallMessage(BinaryMessage message, MessageDirection direction, AliasList list, CRC crc ) { super( message, direction, list, crc ); } diff --git a/src/module/decode/ltrstandard/message/IdleMessage.java b/src/main/java/io/github/dsheirer/module/decode/ltrstandard/message/IdleMessage.java similarity index 79% rename from src/module/decode/ltrstandard/message/IdleMessage.java rename to src/main/java/io/github/dsheirer/module/decode/ltrstandard/message/IdleMessage.java index bd856634..d6629e94 100644 --- a/src/module/decode/ltrstandard/message/IdleMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/ltrstandard/message/IdleMessage.java @@ -15,18 +15,18 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.ltrstandard.message; +package io.github.dsheirer.module.decode.ltrstandard.message; -import message.MessageDirection; -import message.MessageType; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRC; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRC; +import io.github.dsheirer.message.MessageDirection; +import io.github.dsheirer.message.MessageType; public class IdleMessage extends LTRStandardMessage { - public IdleMessage( BinaryMessage message, MessageDirection direction, - AliasList list, CRC crc ) + public IdleMessage(BinaryMessage message, MessageDirection direction, + AliasList list, CRC crc ) { super( message, direction, list, crc ); } diff --git a/src/module/decode/ltrstandard/message/LTRStandardMessage.java b/src/main/java/io/github/dsheirer/module/decode/ltrstandard/message/LTRStandardMessage.java similarity index 91% rename from src/module/decode/ltrstandard/message/LTRStandardMessage.java rename to src/main/java/io/github/dsheirer/module/decode/ltrstandard/message/LTRStandardMessage.java index 424d908a..d977c3ea 100644 --- a/src/module/decode/ltrstandard/message/LTRStandardMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/ltrstandard/message/LTRStandardMessage.java @@ -15,25 +15,23 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.ltrstandard.message; +package io.github.dsheirer.module.decode.ltrstandard.message; + +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRC; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.message.MessageDirection; +import io.github.dsheirer.message.MessageType; +import io.github.dsheirer.module.decode.DecoderType; +import org.apache.commons.lang3.StringUtils; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; -import message.Message; -import message.MessageDirection; -import message.MessageType; -import module.decode.DecoderType; - -import org.apache.commons.lang3.StringUtils; - -import alias.Alias; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRC; - public abstract class LTRStandardMessage extends Message { protected SimpleDateFormat mDatestampFormatter = diff --git a/src/module/decode/ltrstandard/message/UnknownMessage.java b/src/main/java/io/github/dsheirer/module/decode/ltrstandard/message/UnknownMessage.java similarity index 80% rename from src/module/decode/ltrstandard/message/UnknownMessage.java rename to src/main/java/io/github/dsheirer/module/decode/ltrstandard/message/UnknownMessage.java index bb4818aa..41f13ccf 100644 --- a/src/module/decode/ltrstandard/message/UnknownMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/ltrstandard/message/UnknownMessage.java @@ -15,18 +15,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.ltrstandard.message; +package io.github.dsheirer.module.decode.ltrstandard.message; -import message.MessageDirection; -import message.MessageType; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRC; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRC; +import io.github.dsheirer.message.MessageDirection; +import io.github.dsheirer.message.MessageType; public class UnknownMessage extends LTRStandardMessage { - public UnknownMessage( BinaryMessage message, MessageDirection direction, - AliasList list, CRC crc ) + public UnknownMessage(BinaryMessage message, MessageDirection direction, AliasList list, CRC crc ) { super( message, direction, list, crc ); } diff --git a/src/module/decode/mdc1200/MDCCallEvent.java b/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCCallEvent.java similarity index 93% rename from src/module/decode/mdc1200/MDCCallEvent.java rename to src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCCallEvent.java index 0b47482c..05933a40 100644 --- a/src/module/decode/mdc1200/MDCCallEvent.java +++ b/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCCallEvent.java @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.mdc1200; +package io.github.dsheirer.module.decode.mdc1200; -import module.decode.DecoderType; -import module.decode.event.CallEvent; -import alias.Alias; -import alias.AliasList; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.module.decode.event.CallEvent; public class MDCCallEvent extends CallEvent { @@ -30,7 +30,7 @@ public class MDCCallEvent extends CallEvent String toID, String details ) { - super( DecoderType.MDC1200, callEventType, + super( DecoderType.MDC1200, callEventType, aliasList, fromID, toID, details ); } diff --git a/src/module/decode/mdc1200/MDCDecoder.java b/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCDecoder.java similarity index 84% rename from src/module/decode/mdc1200/MDCDecoder.java rename to src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCDecoder.java index 89f04afc..beaf51da 100644 --- a/src/module/decode/mdc1200/MDCDecoder.java +++ b/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCDecoder.java @@ -15,34 +15,33 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.mdc1200; +package io.github.dsheirer.module.decode.mdc1200; -import instrument.Instrumentable; -import instrument.tap.Tap; -import instrument.tap.TapGroup; -import instrument.tap.stream.BinaryTap; -import instrument.tap.stream.FloatBufferTap; -import instrument.tap.stream.FloatTap; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.MessageFramer; +import io.github.dsheirer.bits.SyncPattern; +import io.github.dsheirer.dsp.NRZDecoder; +import io.github.dsheirer.dsp.filter.Filters; +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.dsp.fsk.FSK2Decoder; +import io.github.dsheirer.dsp.fsk.FSK2Decoder.Output; +import io.github.dsheirer.instrument.Instrumentable; +import io.github.dsheirer.instrument.tap.Tap; +import io.github.dsheirer.instrument.tap.TapGroup; +import io.github.dsheirer.instrument.tap.stream.BinaryTap; +import io.github.dsheirer.instrument.tap.stream.FloatBufferTap; +import io.github.dsheirer.instrument.tap.stream.FloatTap; +import io.github.dsheirer.module.decode.Decoder; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.IFilteredRealBufferListener; +import io.github.dsheirer.sample.real.RealBuffer; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ScheduledExecutorService; -import module.decode.Decoder; -import module.decode.DecoderType; -import sample.Listener; -import sample.real.IFilteredRealBufferListener; -import sample.real.RealBuffer; -import alias.AliasList; -import bits.MessageFramer; -import bits.SyncPattern; -import dsp.NRZDecoder; -import dsp.filter.Filters; -import dsp.filter.fir.real.RealFIRFilter_RB_RB; -import dsp.filter.halfband.real.HalfBandFilter_RB_RB; -import dsp.fsk.FSK2Decoder; -import dsp.fsk.FSK2Decoder.Output; - /** * MDC1200 Decoder - 1200 baud 2FSK decoder that can process 48k sample rate * complex or floating point samples and output fully framed MDC1200 messages diff --git a/src/module/decode/mdc1200/MDCDecoderState.java b/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCDecoderState.java similarity index 89% rename from src/module/decode/mdc1200/MDCDecoderState.java rename to src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCDecoderState.java index eecd0de9..379b4037 100644 --- a/src/module/decode/mdc1200/MDCDecoderState.java +++ b/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCDecoderState.java @@ -16,21 +16,21 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.mdc1200; +package io.github.dsheirer.module.decode.mdc1200; -import alias.Alias; -import alias.AliasList; -import alias.id.AliasIDType; -import channel.metadata.AliasedStringAttributeMonitor; -import channel.metadata.Attribute; -import channel.metadata.AttributeChangeRequest; -import channel.state.DecoderState; -import channel.state.DecoderStateEvent; -import channel.state.DecoderStateEvent.Event; -import channel.state.State; -import message.Message; -import module.decode.DecoderType; -import util.StringUtils; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.alias.id.AliasIDType; +import io.github.dsheirer.channel.metadata.AliasedStringAttributeMonitor; +import io.github.dsheirer.channel.metadata.Attribute; +import io.github.dsheirer.channel.metadata.AttributeChangeRequest; +import io.github.dsheirer.channel.state.DecoderState; +import io.github.dsheirer.channel.state.DecoderStateEvent; +import io.github.dsheirer.channel.state.DecoderStateEvent.Event; +import io.github.dsheirer.channel.state.State; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.util.StringUtils; import java.util.Iterator; import java.util.TreeSet; diff --git a/src/module/decode/mdc1200/MDCMessage.java b/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCMessage.java similarity index 95% rename from src/module/decode/mdc1200/MDCMessage.java rename to src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCMessage.java index adb809a3..f73027df 100644 --- a/src/module/decode/mdc1200/MDCMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCMessage.java @@ -15,19 +15,19 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.mdc1200; +package io.github.dsheirer.module.decode.mdc1200; + +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.map.Plottable; +import io.github.dsheirer.message.Message; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; -import map.Plottable; -import message.Message; -import alias.Alias; -import alias.AliasList; -import bits.BinaryMessage; - public class MDCMessage extends Message { private static SimpleDateFormat mSDF = new SimpleDateFormat( "yyyyMMdd HHmmss" ); @@ -316,7 +316,7 @@ public class MDCMessage extends Message } /** - * Provides a listing of aliases contained in the message. + * Provides a listing of aliases contained in the message. */ public List getAliases() { diff --git a/src/module/decode/mdc1200/MDCMessageFilter.java b/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCMessageFilter.java similarity index 85% rename from src/module/decode/mdc1200/MDCMessageFilter.java rename to src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCMessageFilter.java index 9da68f8a..1cae450d 100644 --- a/src/module/decode/mdc1200/MDCMessageFilter.java +++ b/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCMessageFilter.java @@ -1,13 +1,13 @@ -package module.decode.mdc1200; +package io.github.dsheirer.module.decode.mdc1200; + +import io.github.dsheirer.filter.Filter; +import io.github.dsheirer.filter.FilterElement; +import io.github.dsheirer.message.Message; import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import message.Message; -import filter.Filter; -import filter.FilterElement; - public class MDCMessageFilter extends Filter { private HashMap> mElements = diff --git a/src/module/decode/mdc1200/MDCMessageProcessor.java b/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCMessageProcessor.java similarity index 93% rename from src/module/decode/mdc1200/MDCMessageProcessor.java rename to src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCMessageProcessor.java index a1992092..b4511e93 100644 --- a/src/module/decode/mdc1200/MDCMessageProcessor.java +++ b/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCMessageProcessor.java @@ -15,13 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.mdc1200; +package io.github.dsheirer.module.decode.mdc1200; -import message.Message; -import sample.Broadcaster; -import sample.Listener; -import alias.AliasList; -import bits.BinaryMessage; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.sample.Broadcaster; +import io.github.dsheirer.sample.Listener; public class MDCMessageProcessor implements Listener { diff --git a/src/module/decode/mdc1200/MDCMessageType.java b/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCMessageType.java similarity index 96% rename from src/module/decode/mdc1200/MDCMessageType.java rename to src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCMessageType.java index feae9aed..b305e8cb 100644 --- a/src/module/decode/mdc1200/MDCMessageType.java +++ b/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCMessageType.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.mdc1200; +package io.github.dsheirer.module.decode.mdc1200; public enum MDCMessageType { diff --git a/src/main/java/io/github/dsheirer/module/decode/mpt1327/DecodeConfigMPT1327.java b/src/main/java/io/github/dsheirer/module/decode/mpt1327/DecodeConfigMPT1327.java new file mode 100644 index 00000000..172ee2e7 --- /dev/null +++ b/src/main/java/io/github/dsheirer/module/decode/mpt1327/DecodeConfigMPT1327.java @@ -0,0 +1,106 @@ +/******************************************************************************* + * 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 + ******************************************************************************/ +package io.github.dsheirer.module.decode.mpt1327; + +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.module.decode.config.DecodeConfiguration; +import io.github.dsheirer.module.decode.mpt1327.MPT1327Decoder.Sync; + +public class DecodeConfigMPT1327 extends DecodeConfiguration +{ + private String mChannelMapName; + private Sync mSync = Sync.NORMAL; + + private int mCallTimeout = DEFAULT_CALL_TIMEOUT_SECONDS; + private int mTrafficChannelPoolSize = TRAFFIC_CHANNEL_LIMIT_DEFAULT; + + public DecodeConfigMPT1327() + { + } + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + public DecoderType getDecoderType() + { + return DecoderType.MPT1327; + } + + @JacksonXmlProperty(isAttribute = false, localName = "channelMapName") + public String getChannelMapName() + { + return mChannelMapName; + } + + public void setChannelMapName(String name) + { + mChannelMapName = name; + } + + @JacksonXmlProperty(isAttribute = true, localName = "sync") + public Sync getSync() + { + return mSync; + } + + public void setSync(Sync sync) + { + mSync = sync; + } + + @JacksonXmlProperty(isAttribute = true, localName = "call_timeout") + public int getCallTimeout() + { + return mCallTimeout; + } + + /** + * Sets the call timeout value in seconds ( 10 - 600 ); + * + * @param timeout + */ + public void setCallTimeout(int timeout) + { + if(CALL_TIMEOUT_MINIMUM <= timeout && timeout <= CALL_TIMEOUT_MAXIMUM) + { + mCallTimeout = timeout; + } + else + { + mCallTimeout = DEFAULT_CALL_TIMEOUT_SECONDS; + } + } + + @JacksonXmlProperty(isAttribute = true, localName = "traffic_channel_pool_size") + public int getTrafficChannelPoolSize() + { + return mTrafficChannelPoolSize; + } + + /** + * Sets the traffic channel pool size which is the maximum number of + * simultaneous traffic channels that can be allocated. + * + * This limits the maximum calls so that busy systems won't cause more + * traffic channels to be allocated than the decoder/software/host computer + * can support. + */ + public void setTrafficChannelPoolSize(int size) + { + mTrafficChannelPoolSize = size; + } +} diff --git a/src/module/decode/mpt1327/MPT1327CallEvent.java b/src/main/java/io/github/dsheirer/module/decode/mpt1327/MPT1327CallEvent.java similarity index 90% rename from src/module/decode/mpt1327/MPT1327CallEvent.java rename to src/main/java/io/github/dsheirer/module/decode/mpt1327/MPT1327CallEvent.java index abeec4be..776a6d8c 100644 --- a/src/module/decode/mpt1327/MPT1327CallEvent.java +++ b/src/main/java/io/github/dsheirer/module/decode/mpt1327/MPT1327CallEvent.java @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.mpt1327; +package io.github.dsheirer.module.decode.mpt1327; -import module.decode.DecoderType; -import module.decode.event.CallEvent; -import alias.Alias; -import alias.AliasList; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.module.decode.event.CallEvent; public class MPT1327CallEvent extends CallEvent { @@ -35,14 +35,14 @@ public class MPT1327CallEvent extends CallEvent long frequency, String details ) { - super( DecoderType.MPT1327, callEventType, + super( DecoderType.MPT1327, callEventType, aliasList, fromID, toID, details ); mChannel = channel; mFrequency = frequency; } - private Alias getAlias( String mpt1327Talkgroup ) + private Alias getAlias(String mpt1327Talkgroup ) { if( hasAliasList() ) { diff --git a/src/module/decode/mpt1327/MPT1327Decoder.java b/src/main/java/io/github/dsheirer/module/decode/mpt1327/MPT1327Decoder.java similarity index 87% rename from src/module/decode/mpt1327/MPT1327Decoder.java rename to src/main/java/io/github/dsheirer/module/decode/mpt1327/MPT1327Decoder.java index 15163f11..d78d3670 100644 --- a/src/module/decode/mpt1327/MPT1327Decoder.java +++ b/src/main/java/io/github/dsheirer/module/decode/mpt1327/MPT1327Decoder.java @@ -16,32 +16,31 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.mpt1327; +package io.github.dsheirer.module.decode.mpt1327; -import alias.AliasList; -import bits.MessageFramer; -import bits.SyncPattern; -import dsp.filter.FilterFactory; -import dsp.filter.Filters; -import dsp.filter.fir.FIRFilterSpecification; -import dsp.filter.fir.real.RealFIRFilter_RB_RB; -import dsp.filter.halfband.real.HalfBandFilter_RB_RB; -import dsp.fsk.FSK2Decoder; -import dsp.fsk.FSK2Decoder.Output; -import instrument.Instrumentable; -import instrument.tap.Tap; -import instrument.tap.TapGroup; -import instrument.tap.stream.BinaryTap; -import instrument.tap.stream.FloatBufferTap; -import instrument.tap.stream.FloatTap; -import module.decode.Decoder; -import module.decode.DecoderType; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.MessageFramer; +import io.github.dsheirer.bits.SyncPattern; +import io.github.dsheirer.dsp.filter.FilterFactory; +import io.github.dsheirer.dsp.filter.Filters; +import io.github.dsheirer.dsp.filter.fir.FIRFilterSpecification; +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.dsp.fsk.FSK2Decoder; +import io.github.dsheirer.instrument.Instrumentable; +import io.github.dsheirer.instrument.tap.Tap; +import io.github.dsheirer.instrument.tap.TapGroup; +import io.github.dsheirer.instrument.tap.stream.BinaryTap; +import io.github.dsheirer.instrument.tap.stream.FloatBufferTap; +import io.github.dsheirer.instrument.tap.stream.FloatTap; +import io.github.dsheirer.module.decode.Decoder; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.sample.Broadcaster; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.IFilteredRealBufferListener; +import io.github.dsheirer.sample.real.RealBuffer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Broadcaster; -import sample.Listener; -import sample.real.IFilteredRealBufferListener; -import sample.real.RealBuffer; import java.util.ArrayList; import java.util.List; @@ -115,11 +114,11 @@ public class MPT1327Decoder extends Decoder implements IFilteredRealBufferListen */ if(sync == Sync.NORMAL) { - mFSKDecoder = new FSK2Decoder(24000, 1200, Output.INVERTED); + mFSKDecoder = new FSK2Decoder(24000, 1200, FSK2Decoder.Output.INVERTED); } else if(sync == Sync.FRENCH) { - mFSKDecoder = new FSK2Decoder(24000, 1200, Output.NORMAL); + mFSKDecoder = new FSK2Decoder(24000, 1200, FSK2Decoder.Output.NORMAL); } else { diff --git a/src/module/decode/mpt1327/MPT1327DecoderEditor.java b/src/main/java/io/github/dsheirer/module/decode/mpt1327/MPT1327DecoderEditor.java similarity index 94% rename from src/module/decode/mpt1327/MPT1327DecoderEditor.java rename to src/main/java/io/github/dsheirer/module/decode/mpt1327/MPT1327DecoderEditor.java index c013c742..4f20d9b4 100644 --- a/src/module/decode/mpt1327/MPT1327DecoderEditor.java +++ b/src/main/java/io/github/dsheirer/module/decode/mpt1327/MPT1327DecoderEditor.java @@ -16,16 +16,16 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.mpt1327; +package io.github.dsheirer.module.decode.mpt1327; -import controller.channel.Channel; -import controller.channel.map.ChannelMap; -import controller.channel.map.ChannelMapManagerFrame; -import controller.channel.map.ChannelMapModel; -import gui.editor.Editor; -import gui.editor.EditorValidationException; -import gui.editor.ValidatingEditor; -import module.decode.config.DecodeConfiguration; +import io.github.dsheirer.controller.channel.Channel; +import io.github.dsheirer.controller.channel.map.ChannelMap; +import io.github.dsheirer.controller.channel.map.ChannelMapManagerFrame; +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.gui.editor.ValidatingEditor; +import io.github.dsheirer.module.decode.config.DecodeConfiguration; import net.miginfocom.swing.MigLayout; import javax.swing.*; diff --git a/src/module/decode/mpt1327/MPT1327DecoderState.java b/src/main/java/io/github/dsheirer/module/decode/mpt1327/MPT1327DecoderState.java similarity index 92% rename from src/module/decode/mpt1327/MPT1327DecoderState.java rename to src/main/java/io/github/dsheirer/module/decode/mpt1327/MPT1327DecoderState.java index a70b96fa..ca931381 100644 --- a/src/module/decode/mpt1327/MPT1327DecoderState.java +++ b/src/main/java/io/github/dsheirer/module/decode/mpt1327/MPT1327DecoderState.java @@ -16,31 +16,29 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.mpt1327; +package io.github.dsheirer.module.decode.mpt1327; -import alias.Alias; -import alias.AliasList; -import alias.id.AliasIDType; -import channel.metadata.AliasedStringAttributeMonitor; -import channel.metadata.Attribute; -import channel.metadata.AttributeChangeRequest; -import channel.state.ChangeChannelTimeoutEvent; -import channel.state.DecoderState; -import channel.state.DecoderStateEvent; -import channel.state.DecoderStateEvent.Event; -import channel.state.State; -import channel.traffic.TrafficChannelAllocationEvent; -import controller.channel.Channel.ChannelType; -import controller.channel.map.ChannelMap; -import message.Message; -import module.decode.DecoderType; -import module.decode.config.DecodeConfiguration; -import module.decode.event.CallEvent; -import module.decode.event.CallEvent.CallEventType; -import module.decode.mpt1327.MPT1327Message.IdentType; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.alias.id.AliasIDType; +import io.github.dsheirer.channel.metadata.AliasedStringAttributeMonitor; +import io.github.dsheirer.channel.metadata.Attribute; +import io.github.dsheirer.channel.metadata.AttributeChangeRequest; +import io.github.dsheirer.channel.state.ChangeChannelTimeoutEvent; +import io.github.dsheirer.channel.state.DecoderState; +import io.github.dsheirer.channel.state.DecoderStateEvent; +import io.github.dsheirer.channel.state.DecoderStateEvent.Event; +import io.github.dsheirer.channel.state.State; +import io.github.dsheirer.channel.traffic.TrafficChannelAllocationEvent; +import io.github.dsheirer.controller.channel.Channel.ChannelType; +import io.github.dsheirer.controller.channel.map.ChannelMap; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.module.decode.config.DecodeConfiguration; +import io.github.dsheirer.module.decode.event.CallEvent; +import io.github.dsheirer.util.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import util.StringUtils; import java.util.ArrayList; import java.util.Collections; @@ -121,11 +119,11 @@ public class MPT1327DecoderState extends DecoderState case ACK: mIdents.add(mpt.getFromID()); - IdentType identType = mpt.getIdent1Type(); + MPT1327Message.IdentType identType = mpt.getIdent1Type(); - if(identType == IdentType.REGI) + if(identType == MPT1327Message.IdentType.REGI) { - broadcast(new MPT1327CallEvent.Builder(CallEventType.REGISTER) + broadcast(new MPT1327CallEvent.Builder(CallEvent.CallEventType.REGISTER) .aliasList(getAliasList()) .channel(String.valueOf(mChannelNumber)) .details("REGISTERED ON NETWORK") @@ -136,7 +134,7 @@ public class MPT1327DecoderState extends DecoderState } else { - broadcast(new MPT1327CallEvent.Builder(CallEventType.RESPONSE) + broadcast(new MPT1327CallEvent.Builder(CallEvent.CallEventType.RESPONSE) .aliasList(getAliasList()) .channel(String.valueOf(mChannelNumber)) .details("ACK " + identType.getLabel()) @@ -157,7 +155,7 @@ public class MPT1327DecoderState extends DecoderState case AHYC: mIdents.add(mpt.getToID()); - broadcast(new MPT1327CallEvent.Builder(CallEventType.COMMAND) + broadcast(new MPT1327CallEvent.Builder(CallEvent.CallEventType.COMMAND) .aliasList(getAliasList()) .channel(String.valueOf(mChannelNumber)) .details(((MPT1327Message) message).getRequestString()) @@ -169,7 +167,7 @@ public class MPT1327DecoderState extends DecoderState broadcast(new DecoderStateEvent(this, Event.CONTINUATION, State.CONTROL)); break; case AHYQ: - broadcast(new MPT1327CallEvent.Builder(CallEventType.STATUS) + broadcast(new MPT1327CallEvent.Builder(CallEvent.CallEventType.STATUS) .aliasList(getAliasList()) .channel(String.valueOf(mChannelNumber)) .details(mpt.getStatusMessage()) @@ -228,7 +226,7 @@ public class MPT1327DecoderState extends DecoderState frequency = getChannelMap().getFrequency(channel); } - CallEvent event = new MPT1327CallEvent.Builder(CallEventType.CALL) + CallEvent event = new MPT1327CallEvent.Builder(CallEvent.CallEventType.CALL) .aliasList(getAliasList()) .channel(String.valueOf(channel)) .details("GTC") @@ -243,7 +241,7 @@ public class MPT1327DecoderState extends DecoderState case HEAD_PLUS2: case HEAD_PLUS3: case HEAD_PLUS4: - broadcast(new MPT1327CallEvent.Builder(CallEventType.SDM) + broadcast(new MPT1327CallEvent.Builder(CallEvent.CallEventType.SDM) .aliasList(getAliasList()) .details(mpt.getMessage()) .from(mpt.getFromID()) @@ -272,7 +270,7 @@ public class MPT1327DecoderState extends DecoderState if(mCurrentCallEvent == null) { - mCurrentCallEvent = new MPT1327CallEvent.Builder(CallEventType.CALL) + mCurrentCallEvent = new MPT1327CallEvent.Builder(CallEvent.CallEventType.CALL) .aliasList(getAliasList()) .channel(String.valueOf(mChannelNumber)) .details("MONITORED TRAFFIC CHANNEL") diff --git a/src/module/decode/mpt1327/MPT1327Message.java b/src/main/java/io/github/dsheirer/module/decode/mpt1327/MPT1327Message.java similarity index 99% rename from src/module/decode/mpt1327/MPT1327Message.java rename to src/main/java/io/github/dsheirer/module/decode/mpt1327/MPT1327Message.java index 8e0d1f4b..23cdf37b 100644 --- a/src/module/decode/mpt1327/MPT1327Message.java +++ b/src/main/java/io/github/dsheirer/module/decode/mpt1327/MPT1327Message.java @@ -15,7 +15,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.mpt1327; +package io.github.dsheirer.module.decode.mpt1327; + +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRC; +import io.github.dsheirer.edac.CRCFleetsync; +import io.github.dsheirer.map.Plottable; +import io.github.dsheirer.message.Message; import java.text.DecimalFormat; import java.text.SimpleDateFormat; @@ -26,14 +34,6 @@ import java.util.Date; import java.util.GregorianCalendar; import java.util.List; -import map.Plottable; -import message.Message; -import alias.Alias; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRC; -import edac.CRCFleetsync; - public class MPT1327Message extends Message { private static String[] TELEX_LETTERS = @@ -979,7 +979,7 @@ public class MPT1327Message extends Message } /** - * Data message codeword descriptor. Indicates the type of data message + * Data message codeword descriptor. Indicates the type of data message * that the radio unit shall respond with. */ public Descriptor getDescriptor() @@ -1052,7 +1052,7 @@ public class MPT1327Message extends Message } /** - * Used by the map to get a plottable version of this event + * Used by the map to get a plottable version of this event */ @Override public Plottable getPlottable() @@ -1550,7 +1550,7 @@ public class MPT1327Message extends Message } /** - * Provides a listing of aliases contained in the message. + * Provides a listing of aliases contained in the message. */ public List getAliases() { diff --git a/src/module/decode/mpt1327/MPT1327MessageFilter.java b/src/main/java/io/github/dsheirer/module/decode/mpt1327/MPT1327MessageFilter.java similarity index 82% rename from src/module/decode/mpt1327/MPT1327MessageFilter.java rename to src/main/java/io/github/dsheirer/module/decode/mpt1327/MPT1327MessageFilter.java index 6ad9be50..21f0c9f4 100644 --- a/src/module/decode/mpt1327/MPT1327MessageFilter.java +++ b/src/main/java/io/github/dsheirer/module/decode/mpt1327/MPT1327MessageFilter.java @@ -1,14 +1,14 @@ -package module.decode.mpt1327; +package io.github.dsheirer.module.decode.mpt1327; + +import io.github.dsheirer.filter.Filter; +import io.github.dsheirer.filter.FilterElement; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.module.decode.mpt1327.MPT1327Message.MPTMessageType; import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import message.Message; -import module.decode.mpt1327.MPT1327Message.MPTMessageType; -import filter.Filter; -import filter.FilterElement; - public class MPT1327MessageFilter extends Filter { private HashMap> mFilterElements = diff --git a/src/module/decode/mpt1327/MPT1327MessageProcessor.java b/src/main/java/io/github/dsheirer/module/decode/mpt1327/MPT1327MessageProcessor.java similarity index 88% rename from src/module/decode/mpt1327/MPT1327MessageProcessor.java rename to src/main/java/io/github/dsheirer/module/decode/mpt1327/MPT1327MessageProcessor.java index b4d6b805..d8a145e3 100644 --- a/src/module/decode/mpt1327/MPT1327MessageProcessor.java +++ b/src/main/java/io/github/dsheirer/module/decode/mpt1327/MPT1327MessageProcessor.java @@ -15,17 +15,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.mpt1327; - -import message.Message; +package io.github.dsheirer.module.decode.mpt1327; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.sample.Listener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; -import alias.AliasList; -import bits.BinaryMessage; - public class MPT1327MessageProcessor implements Listener { private final static Logger mLog = LoggerFactory.getLogger( MPT1327MessageProcessor.class ); diff --git a/src/module/decode/passport/DecodeConfigPassport.java b/src/main/java/io/github/dsheirer/module/decode/nbfm/DecodeConfigNBFM.java similarity index 62% rename from src/module/decode/passport/DecodeConfigPassport.java rename to src/main/java/io/github/dsheirer/module/decode/nbfm/DecodeConfigNBFM.java index 4ec50db4..87189144 100644 --- a/src/module/decode/passport/DecodeConfigPassport.java +++ b/src/main/java/io/github/dsheirer/module/decode/nbfm/DecodeConfigNBFM.java @@ -1,29 +1,36 @@ /******************************************************************************* * 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 ******************************************************************************/ -package module.decode.passport; +package io.github.dsheirer.module.decode.nbfm; -import module.decode.DecoderType; -import module.decode.config.DecodeConfiguration; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.module.decode.config.DecodeConfiguration; -public class DecodeConfigPassport extends DecodeConfiguration +public class DecodeConfigNBFM extends DecodeConfiguration { - public DecodeConfigPassport() + public DecodeConfigNBFM() { - super( DecoderType.PASSPORT ); } + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + public DecoderType getDecoderType() + { + return DecoderType.NBFM; + } + } diff --git a/src/module/decode/nbfm/NBFMDecoder.java b/src/main/java/io/github/dsheirer/module/decode/nbfm/NBFMDecoder.java similarity index 85% rename from src/module/decode/nbfm/NBFMDecoder.java rename to src/main/java/io/github/dsheirer/module/decode/nbfm/NBFMDecoder.java index 1b055a91..3e0e326d 100644 --- a/src/module/decode/nbfm/NBFMDecoder.java +++ b/src/main/java/io/github/dsheirer/module/decode/nbfm/NBFMDecoder.java @@ -15,14 +15,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.nbfm; +package io.github.dsheirer.module.decode.nbfm; + + +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.module.decode.PrimaryDecoder; +import io.github.dsheirer.module.decode.config.DecodeConfiguration; import java.util.concurrent.ScheduledExecutorService; -import module.decode.DecoderType; -import module.decode.PrimaryDecoder; -import module.decode.config.DecodeConfiguration; - public class NBFMDecoder extends PrimaryDecoder { public NBFMDecoder( DecodeConfiguration config ) diff --git a/src/module/decode/nbfm/NBFMDecoderEditor.java b/src/main/java/io/github/dsheirer/module/decode/nbfm/NBFMDecoderEditor.java similarity index 92% rename from src/module/decode/nbfm/NBFMDecoderEditor.java rename to src/main/java/io/github/dsheirer/module/decode/nbfm/NBFMDecoderEditor.java index 9d6d025c..a5e32a0d 100644 --- a/src/module/decode/nbfm/NBFMDecoderEditor.java +++ b/src/main/java/io/github/dsheirer/module/decode/nbfm/NBFMDecoderEditor.java @@ -15,23 +15,20 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.nbfm; +package io.github.dsheirer.module.decode.nbfm; -import gui.editor.Editor; -import gui.editor.EditorValidationException; -import gui.editor.ValidatingEditor; +import io.github.dsheirer.controller.channel.Channel; +import io.github.dsheirer.gui.editor.Editor; +import io.github.dsheirer.gui.editor.EditorValidationException; +import io.github.dsheirer.gui.editor.ValidatingEditor; +import io.github.dsheirer.module.decode.config.DecodeConfiguration; +import net.miginfocom.swing.MigLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.JCheckBox; -import javax.swing.JSlider; +import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; - -import module.decode.config.DecodeConfiguration; -import net.miginfocom.swing.MigLayout; -import controller.channel.Channel; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; public class NBFMDecoderEditor extends ValidatingEditor { diff --git a/src/module/decode/p25/C4FMFrameListener.java b/src/main/java/io/github/dsheirer/module/decode/p25/C4FMFrameListener.java similarity index 78% rename from src/module/decode/p25/C4FMFrameListener.java rename to src/main/java/io/github/dsheirer/module/decode/p25/C4FMFrameListener.java index befb0468..cbed79d8 100644 --- a/src/module/decode/p25/C4FMFrameListener.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/C4FMFrameListener.java @@ -1,6 +1,6 @@ -package module.decode.p25; +package io.github.dsheirer.module.decode.p25; -import bits.BinaryMessage; +import io.github.dsheirer.bits.BinaryMessage; public interface C4FMFrameListener { diff --git a/src/module/decode/p25/C4FMSlicer.java b/src/main/java/io/github/dsheirer/module/decode/p25/C4FMSlicer.java similarity index 86% rename from src/module/decode/p25/C4FMSlicer.java rename to src/main/java/io/github/dsheirer/module/decode/p25/C4FMSlicer.java index 5c5e2575..afdac1f3 100644 --- a/src/module/decode/p25/C4FMSlicer.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/C4FMSlicer.java @@ -1,9 +1,9 @@ -package module.decode.p25; +package io.github.dsheirer.module.decode.p25; -import dsp.symbol.Dibit; -import sample.Broadcaster; -import sample.Listener; -import sample.real.RealSampleListener; +import io.github.dsheirer.dsp.symbol.Dibit; +import io.github.dsheirer.sample.Broadcaster; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.RealSampleListener; /** * C4FM slicer to convert the output stream of the C4FMSymbolFilter into a @@ -26,7 +26,7 @@ public class C4FMSlicer implements RealSampleListener /** * Primary method for receiving output from the C4FMSymbolFilter. Slices - * (converts) the filtered sample value into a C4FMSymbol decision. + * (converts) the filtered sample value into a C4FMSymbol decision. */ @Override public void receive( float sample ) diff --git a/src/module/decode/p25/C4FMSymbolFilter.java b/src/main/java/io/github/dsheirer/module/decode/p25/C4FMSymbolFilter.java similarity index 97% rename from src/module/decode/p25/C4FMSymbolFilter.java rename to src/main/java/io/github/dsheirer/module/decode/p25/C4FMSymbolFilter.java index 51e7b78d..7279a511 100644 --- a/src/module/decode/p25/C4FMSymbolFilter.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/C4FMSymbolFilter.java @@ -1,26 +1,22 @@ -package module.decode.p25; +package io.github.dsheirer.module.decode.p25; -import instrument.Instrumentable; -import instrument.tap.Tap; -import instrument.tap.TapGroup; -import instrument.tap.stream.AdditiveFloatTap; -import instrument.tap.stream.FloatTap; +import io.github.dsheirer.dsp.gain.DirectGainControl; +import io.github.dsheirer.instrument.Instrumentable; +import io.github.dsheirer.instrument.tap.Tap; +import io.github.dsheirer.instrument.tap.TapGroup; +import io.github.dsheirer.instrument.tap.stream.AdditiveFloatTap; +import io.github.dsheirer.instrument.tap.stream.FloatTap; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.RealBuffer; +import io.github.dsheirer.sample.real.RealSampleListener; +import io.github.dsheirer.sample.real.RealSampleProvider; +import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent; +import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent.Event; +import io.github.dsheirer.source.tuner.frequency.IFrequencyChangeListener; import java.util.ArrayList; import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import sample.Listener; -import sample.real.RealBuffer; -import sample.real.RealSampleListener; -import sample.real.RealSampleProvider; -import source.tuner.TunerChannelSource; -import source.tuner.frequency.FrequencyChangeEvent; -import source.tuner.frequency.FrequencyChangeEvent.Event; -import source.tuner.frequency.IFrequencyChangeListener; -import dsp.gain.DirectGainControl; - public class C4FMSymbolFilter implements Listener, IFrequencyChangeListener, RealSampleProvider, Instrumentable { private static final float TAPS[][] = @@ -241,8 +237,8 @@ public class C4FMSymbolFilter implements Listener, IFrequencyChangeL } /* If a frequency correction was requested during the processing of this - * buffer, we'll apply the change and it will be reflected in the next - * arriving buffer. Reset the lock on frequency correction and reset + * buffer, we'll apply the change and it will be reflected in the next + * arriving buffer. Reset the lock on frequency correction and reset * the internal frequency correction tracker */ if( mFrequencyAdjustmentRequested != 0 ) { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/DecodeConfigP25Phase1.java b/src/main/java/io/github/dsheirer/module/decode/p25/DecodeConfigP25Phase1.java new file mode 100644 index 00000000..03aec81b --- /dev/null +++ b/src/main/java/io/github/dsheirer/module/decode/p25/DecodeConfigP25Phase1.java @@ -0,0 +1,113 @@ +/******************************************************************************* + * 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 + ******************************************************************************/ +package io.github.dsheirer.module.decode.p25; + + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.module.decode.config.DecodeConfiguration; + +public class DecodeConfigP25Phase1 extends DecodeConfiguration +{ + private P25_LSMDecoder.Modulation mModulation = P25Decoder.Modulation.C4FM; + + private int mCallTimeout = 1; + private int mTrafficChannelPoolSize = TRAFFIC_CHANNEL_LIMIT_DEFAULT; + private boolean mIgnoreDataCalls = true; + + public DecodeConfigP25Phase1() + { + setAFC(false); + } + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + public DecoderType getDecoderType() + { + return DecoderType.P25_PHASE1; + } + + public boolean supportsAFC() + { + return false; + } + + @JacksonXmlProperty(isAttribute = true, localName = "modulation") + public P25_LSMDecoder.Modulation getModulation() + { + return mModulation; + } + + public void setModulation(P25_LSMDecoder.Modulation modulation) + { + mModulation = modulation; + } + + @JacksonXmlProperty(isAttribute = true, localName = "ignore_data_calls") + public boolean getIgnoreDataCalls() + { + return mIgnoreDataCalls; + } + + public void setIgnoreDataCalls(boolean ignore) + { + mIgnoreDataCalls = ignore; + } + + /** + * Note: this field is now deprecated. + * + * @return + */ + @JsonIgnore + @Deprecated + public int getCallTimeout() + { + return mCallTimeout; + } + + /** + * Sets the call timeout value in seconds ( 10 - 600 ); + * + * @param timeout + */ + @Deprecated + public void setCallTimeout(int timeout) + { + } + + + @JacksonXmlProperty(isAttribute = true, localName = "traffic_channel_pool_size") + public int getTrafficChannelPoolSize() + { + return mTrafficChannelPoolSize; + } + + /** + * Sets the traffic channel pool size which is the maximum number of + * simultaneous traffic channels that can be allocated. + * + * This limits the maximum calls so that busy systems won't cause more + * traffic channels to be allocated than the decoder/software/host computer + * can support. + */ + public void setTrafficChannelPoolSize(int size) + { + mTrafficChannelPoolSize = size; + } +} diff --git a/src/module/decode/p25/P25CallEvent.java b/src/main/java/io/github/dsheirer/module/decode/p25/P25CallEvent.java similarity index 92% rename from src/module/decode/p25/P25CallEvent.java rename to src/main/java/io/github/dsheirer/module/decode/p25/P25CallEvent.java index b9e24858..99d80555 100644 --- a/src/module/decode/p25/P25CallEvent.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/P25CallEvent.java @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.p25; +package io.github.dsheirer.module.decode.p25; -import module.decode.DecoderType; -import module.decode.event.CallEvent; -import alias.Alias; -import alias.AliasList; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.module.decode.event.CallEvent; public class P25CallEvent extends CallEvent { @@ -35,7 +35,7 @@ public class P25CallEvent extends CallEvent long frequency, String details ) { - super( DecoderType.P25_PHASE1, callEventType, + super( DecoderType.P25_PHASE1, callEventType, aliasList, fromID, toID, details ); mChannel = channel; diff --git a/src/module/decode/p25/P25Decoder.java b/src/main/java/io/github/dsheirer/module/decode/p25/P25Decoder.java similarity index 74% rename from src/module/decode/p25/P25Decoder.java rename to src/main/java/io/github/dsheirer/module/decode/p25/P25Decoder.java index 0ca1f8a9..38e3fdfc 100644 --- a/src/module/decode/p25/P25Decoder.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/P25Decoder.java @@ -1,11 +1,11 @@ -package module.decode.p25; +package io.github.dsheirer.module.decode.p25; -import alias.AliasList; -import instrument.Instrumentable; -import module.decode.Decoder; -import module.decode.DecoderType; -import source.tuner.frequency.IFrequencyChangeListener; -import source.tuner.frequency.IFrequencyChangeProvider; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.instrument.Instrumentable; +import io.github.dsheirer.module.decode.Decoder; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.source.tuner.frequency.IFrequencyChangeListener; +import io.github.dsheirer.source.tuner.frequency.IFrequencyChangeProvider; public abstract class P25Decoder extends Decoder implements IFrequencyChangeListener, IFrequencyChangeProvider, Instrumentable { diff --git a/src/module/decode/p25/P25DecoderEditor.java b/src/main/java/io/github/dsheirer/module/decode/p25/P25DecoderEditor.java similarity index 86% rename from src/module/decode/p25/P25DecoderEditor.java rename to src/main/java/io/github/dsheirer/module/decode/p25/P25DecoderEditor.java index 3d54ace1..e283a708 100644 --- a/src/module/decode/p25/P25DecoderEditor.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/P25DecoderEditor.java @@ -15,36 +15,27 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.p25; +package io.github.dsheirer.module.decode.p25; -import gui.editor.Editor; -import gui.editor.EditorValidationException; -import gui.editor.ValidatingEditor; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.DefaultComboBoxModel; -import javax.swing.JCheckBox; -import javax.swing.JComboBox; -import javax.swing.JLabel; -import javax.swing.JSlider; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - -import module.decode.AuxDecodeConfigurationEditor; -import module.decode.config.AuxDecodeConfiguration; -import module.decode.config.DecodeConfiguration; -import module.decode.p25.P25Decoder.Modulation; +import io.github.dsheirer.controller.channel.Channel; +import io.github.dsheirer.gui.editor.Editor; +import io.github.dsheirer.gui.editor.EditorValidationException; +import io.github.dsheirer.gui.editor.ValidatingEditor; +import io.github.dsheirer.module.decode.AuxDecodeConfigurationEditor; +import io.github.dsheirer.module.decode.config.AuxDecodeConfiguration; +import io.github.dsheirer.module.decode.config.DecodeConfiguration; +import io.github.dsheirer.source.SourceConfigurationEditor; +import io.github.dsheirer.source.config.SourceConfigTuner; +import io.github.dsheirer.source.config.SourceConfiguration; import net.miginfocom.swing.MigLayout; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import source.SourceConfigurationEditor; -import source.config.SourceConfigTuner; -import source.config.SourceConfiguration; -import controller.channel.Channel; +import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; public class P25DecoderEditor extends ValidatingEditor { @@ -124,7 +115,7 @@ public class P25DecoderEditor extends ValidatingEditor { DecodeConfigP25Phase1 p25 = new DecodeConfigP25Phase1(); - p25.setModulation( (Modulation)mComboModulation.getSelectedItem() ); + p25.setModulation( (P25Decoder.Modulation)mComboModulation.getSelectedItem() ); p25.setIgnoreDataCalls( mIgnoreDataCalls.isSelected() ); p25.setTrafficChannelPoolSize( mTrafficChannelPoolSize.getValue() ); @@ -141,7 +132,7 @@ public class P25DecoderEditor extends ValidatingEditor * Enforce CQPSK modulation uses a Tuner Source for I/Q sample data */ if( editor instanceof SourceConfigurationEditor && - ((Modulation)mComboModulation.getSelectedItem()) == Modulation.CQPSK ) + ((P25Decoder.Modulation)mComboModulation.getSelectedItem()) == P25Decoder.Modulation.CQPSK ) { SourceConfiguration config = ((SourceConfigurationEditor)editor).getSourceConfiguration(); @@ -155,7 +146,7 @@ public class P25DecoderEditor extends ValidatingEditor } } - if( editor instanceof AuxDecodeConfigurationEditor ) + if( editor instanceof AuxDecodeConfigurationEditor) { AuxDecodeConfiguration config = ((AuxDecodeConfigurationEditor)editor).getConfiguration(); @@ -210,7 +201,7 @@ public class P25DecoderEditor extends ValidatingEditor } else { - mComboModulation.setSelectedItem( Modulation.C4FM ); + mComboModulation.setSelectedItem( P25Decoder.Modulation.C4FM ); mIgnoreDataCalls.setSelected( false ); mTrafficChannelPoolSize.setValue( DecodeConfiguration.TRAFFIC_CHANNEL_LIMIT_DEFAULT ); setModified( true ); diff --git a/src/module/decode/p25/P25DecoderState.java b/src/main/java/io/github/dsheirer/module/decode/p25/P25DecoderState.java similarity index 83% rename from src/module/decode/p25/P25DecoderState.java rename to src/main/java/io/github/dsheirer/module/decode/p25/P25DecoderState.java index 5072bc31..f73c4b05 100644 --- a/src/module/decode/p25/P25DecoderState.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/P25DecoderState.java @@ -15,120 +15,122 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.p25; +package io.github.dsheirer.module.decode.p25; -import alias.Alias; -import alias.AliasList; -import alias.id.AliasIDType; -import channel.metadata.AliasedStringAttributeMonitor; -import channel.metadata.Attribute; -import channel.metadata.AttributeChangeRequest; -import channel.state.ChangeChannelTimeoutEvent; -import channel.state.DecoderState; -import channel.state.DecoderStateEvent; -import channel.state.DecoderStateEvent.Event; -import channel.state.State; -import channel.traffic.TrafficChannelAllocationEvent; -import controller.channel.Channel.ChannelType; -import message.Message; -import module.decode.DecoderType; -import module.decode.event.CallEvent.CallEventType; -import module.decode.p25.P25Decoder.Modulation; -import module.decode.p25.message.IAdjacentSite; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.P25Message; -import module.decode.p25.message.hdu.HDUMessage; -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.message.ldu.LDUMessage; -import module.decode.p25.message.ldu.lc.CallTermination; -import module.decode.p25.message.ldu.lc.TelephoneInterconnectVoiceChannelUser; -import module.decode.p25.message.ldu.lc.UnitToUnitVoiceChannelUser; -import module.decode.p25.message.pdu.PDUMessage; -import module.decode.p25.message.pdu.confirmed.PDUConfirmedMessage; -import module.decode.p25.message.pdu.confirmed.PDUTypeUnknown; -import module.decode.p25.message.pdu.confirmed.PacketData; -import module.decode.p25.message.pdu.confirmed.SNDCPActivateTDSContextAccept; -import module.decode.p25.message.pdu.confirmed.SNDCPActivateTDSContextReject; -import module.decode.p25.message.pdu.confirmed.SNDCPActivateTDSContextRequest; -import module.decode.p25.message.pdu.confirmed.SNDCPDeactivateTDSContext; -import module.decode.p25.message.pdu.confirmed.SNDCPUserData; -import module.decode.p25.message.pdu.osp.control.AdjacentStatusBroadcastExtended; -import module.decode.p25.message.pdu.osp.control.CallAlertExtended; -import module.decode.p25.message.pdu.osp.control.GroupAffiliationQueryExtended; -import module.decode.p25.message.pdu.osp.control.GroupAffiliationResponseExtended; -import module.decode.p25.message.pdu.osp.control.MessageUpdateExtended; -import module.decode.p25.message.pdu.osp.control.NetworkStatusBroadcastExtended; -import module.decode.p25.message.pdu.osp.control.ProtectionParameterBroadcast; -import module.decode.p25.message.pdu.osp.control.RFSSStatusBroadcastExtended; -import module.decode.p25.message.pdu.osp.control.RoamingAddressUpdateExtended; -import module.decode.p25.message.pdu.osp.control.StatusQueryExtended; -import module.decode.p25.message.pdu.osp.control.StatusUpdateExtended; -import module.decode.p25.message.pdu.osp.control.UnitRegistrationResponseExtended; -import module.decode.p25.message.pdu.osp.data.GroupDataChannelGrantExtended; -import module.decode.p25.message.pdu.osp.data.IndividualDataChannelGrantExtended; -import module.decode.p25.message.pdu.osp.voice.GroupVoiceChannelGrantExplicit; -import module.decode.p25.message.pdu.osp.voice.TelephoneInterconnectChannelGrantExplicit; -import module.decode.p25.message.pdu.osp.voice.UnitToUnitAnswerRequestExplicit; -import module.decode.p25.message.pdu.osp.voice.UnitToUnitVoiceChannelGrantExtended; -import module.decode.p25.message.pdu.osp.voice.UnitToUnitVoiceChannelGrantUpdateExtended; -import module.decode.p25.message.tdu.TDUMessage; -import module.decode.p25.message.tdu.lc.AdjacentSiteStatusBroadcast; -import module.decode.p25.message.tdu.lc.AdjacentSiteStatusBroadcastExplicit; -import module.decode.p25.message.tdu.lc.GroupVoiceChannelUpdate; -import module.decode.p25.message.tdu.lc.GroupVoiceChannelUpdateExplicit; -import module.decode.p25.message.tdu.lc.NetworkStatusBroadcast; -import module.decode.p25.message.tdu.lc.NetworkStatusBroadcastExplicit; -import module.decode.p25.message.tdu.lc.SecondaryControlChannelBroadcast; -import module.decode.p25.message.tdu.lc.SecondaryControlChannelBroadcastExplicit; -import module.decode.p25.message.tdu.lc.TDULinkControlMessage; -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.message.tsbk.motorola.MotorolaTSBKMessage; -import module.decode.p25.message.tsbk.motorola.PatchGroupAdd; -import module.decode.p25.message.tsbk.motorola.PatchGroupDelete; -import module.decode.p25.message.tsbk.motorola.PatchGroupVoiceChannelGrant; -import module.decode.p25.message.tsbk.motorola.PatchGroupVoiceChannelGrantUpdate; -import module.decode.p25.message.tsbk.osp.control.AcknowledgeResponse; -import module.decode.p25.message.tsbk.osp.control.AdjacentStatusBroadcast; -import module.decode.p25.message.tsbk.osp.control.AuthenticationCommand; -import module.decode.p25.message.tsbk.osp.control.CallAlert; -import module.decode.p25.message.tsbk.osp.control.DenyResponse; -import module.decode.p25.message.tsbk.osp.control.ExtendedFunctionCommand; -import module.decode.p25.message.tsbk.osp.control.GroupAffiliationQuery; -import module.decode.p25.message.tsbk.osp.control.GroupAffiliationResponse; -import module.decode.p25.message.tsbk.osp.control.IdentifierUpdate; -import module.decode.p25.message.tsbk.osp.control.LocationRegistrationResponse; -import module.decode.p25.message.tsbk.osp.control.MessageUpdate; -import module.decode.p25.message.tsbk.osp.control.ProtectionParameterUpdate; -import module.decode.p25.message.tsbk.osp.control.QueuedResponse; -import module.decode.p25.message.tsbk.osp.control.RFSSStatusBroadcast; -import module.decode.p25.message.tsbk.osp.control.RadioUnitMonitorCommand; -import module.decode.p25.message.tsbk.osp.control.RoamingAddressCommand; -import module.decode.p25.message.tsbk.osp.control.StatusQuery; -import module.decode.p25.message.tsbk.osp.control.StatusUpdate; -import module.decode.p25.message.tsbk.osp.control.SystemService; -import module.decode.p25.message.tsbk.osp.control.UnitDeregistrationAcknowledge; -import module.decode.p25.message.tsbk.osp.control.UnitRegistrationCommand; -import module.decode.p25.message.tsbk.osp.control.UnitRegistrationResponse; -import module.decode.p25.message.tsbk.osp.data.GroupDataChannelAnnouncement; -import module.decode.p25.message.tsbk.osp.data.GroupDataChannelAnnouncementExplicit; -import module.decode.p25.message.tsbk.osp.data.GroupDataChannelGrant; -import module.decode.p25.message.tsbk.osp.data.IndividualDataChannelGrant; -import module.decode.p25.message.tsbk.osp.data.SNDCPDataChannelAnnouncementExplicit; -import module.decode.p25.message.tsbk.osp.data.SNDCPDataChannelGrant; -import module.decode.p25.message.tsbk.osp.data.SNDCPDataPageRequest; -import module.decode.p25.message.tsbk.osp.voice.GroupVoiceChannelGrant; -import module.decode.p25.message.tsbk.osp.voice.GroupVoiceChannelGrantUpdate; -import module.decode.p25.message.tsbk.osp.voice.GroupVoiceChannelGrantUpdateExplicit; -import module.decode.p25.message.tsbk.osp.voice.TelephoneInterconnectAnswerRequest; -import module.decode.p25.message.tsbk.osp.voice.TelephoneInterconnectVoiceChannelGrant; -import module.decode.p25.message.tsbk.osp.voice.TelephoneInterconnectVoiceChannelGrantUpdate; -import module.decode.p25.message.tsbk.osp.voice.UnitToUnitAnswerRequest; -import module.decode.p25.message.tsbk.osp.voice.UnitToUnitVoiceChannelGrant; -import module.decode.p25.message.tsbk.osp.voice.UnitToUnitVoiceChannelGrantUpdate; -import module.decode.p25.reference.IPProtocol; -import module.decode.p25.reference.LinkControlOpcode; -import module.decode.p25.reference.Response; -import module.decode.p25.reference.Vendor; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.alias.id.AliasIDType; +import io.github.dsheirer.channel.metadata.AliasedStringAttributeMonitor; +import io.github.dsheirer.channel.metadata.Attribute; +import io.github.dsheirer.channel.metadata.AttributeChangeRequest; +import io.github.dsheirer.channel.state.ChangeChannelTimeoutEvent; +import io.github.dsheirer.channel.state.DecoderState; +import io.github.dsheirer.channel.state.DecoderStateEvent; +import io.github.dsheirer.channel.state.DecoderStateEvent.Event; +import io.github.dsheirer.channel.state.State; +import io.github.dsheirer.channel.traffic.TrafficChannelAllocationEvent; +import io.github.dsheirer.controller.channel.Channel.ChannelType; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.module.decode.event.CallEvent; +import io.github.dsheirer.module.decode.p25.message.IAdjacentSite; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.P25Message; +import io.github.dsheirer.module.decode.p25.message.hdu.HDUMessage; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.message.ldu.LDUMessage; +import io.github.dsheirer.module.decode.p25.message.ldu.lc.CallTermination; +import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; +import io.github.dsheirer.module.decode.p25.message.pdu.confirmed.PDUConfirmedMessage; +import io.github.dsheirer.module.decode.p25.message.pdu.confirmed.PDUTypeUnknown; +import io.github.dsheirer.module.decode.p25.message.pdu.confirmed.PacketData; +import io.github.dsheirer.module.decode.p25.message.pdu.confirmed.SNDCPActivateTDSContextAccept; +import io.github.dsheirer.module.decode.p25.message.pdu.confirmed.SNDCPActivateTDSContextReject; +import io.github.dsheirer.module.decode.p25.message.pdu.confirmed.SNDCPActivateTDSContextRequest; +import io.github.dsheirer.module.decode.p25.message.pdu.confirmed.SNDCPDeactivateTDSContext; +import io.github.dsheirer.module.decode.p25.message.pdu.confirmed.SNDCPUserData; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.control.AdjacentStatusBroadcastExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.control.CallAlertExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.control.GroupAffiliationQueryExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.control.GroupAffiliationResponseExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.control.MessageUpdateExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.control.NetworkStatusBroadcastExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.control.ProtectionParameterBroadcast; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.control.RFSSStatusBroadcastExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.control.RoamingAddressUpdateExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.control.StatusQueryExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.control.StatusUpdateExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.control.UnitRegistrationResponseExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.data.GroupDataChannelGrantExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.data.IndividualDataChannelGrantExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.voice.GroupVoiceChannelGrantExplicit; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.voice.TelephoneInterconnectChannelGrantExplicit; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.voice.UnitToUnitAnswerRequestExplicit; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.voice.UnitToUnitVoiceChannelGrantExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.voice.UnitToUnitVoiceChannelGrantUpdateExtended; +import io.github.dsheirer.module.decode.p25.message.tdu.TDUMessage; +import io.github.dsheirer.module.decode.p25.message.tdu.lc.AdjacentSiteStatusBroadcast; +import io.github.dsheirer.module.decode.p25.message.tdu.lc.AdjacentSiteStatusBroadcastExplicit; +import io.github.dsheirer.module.decode.p25.message.tdu.lc.CallAlert; +import io.github.dsheirer.module.decode.p25.message.tdu.lc.ExtendedFunctionCommand; +import io.github.dsheirer.module.decode.p25.message.tdu.lc.GroupAffiliationQuery; +import io.github.dsheirer.module.decode.p25.message.tdu.lc.GroupVoiceChannelUpdate; +import io.github.dsheirer.module.decode.p25.message.tdu.lc.GroupVoiceChannelUpdateExplicit; +import io.github.dsheirer.module.decode.p25.message.tdu.lc.GroupVoiceChannelUser; +import io.github.dsheirer.module.decode.p25.message.tdu.lc.MessageUpdate; +import io.github.dsheirer.module.decode.p25.message.tdu.lc.NetworkStatusBroadcastExplicit; +import io.github.dsheirer.module.decode.p25.message.tdu.lc.RFSSStatusBroadcastExplicit; +import io.github.dsheirer.module.decode.p25.message.tdu.lc.SecondaryControlChannelBroadcastExplicit; +import io.github.dsheirer.module.decode.p25.message.tdu.lc.StatusQuery; +import io.github.dsheirer.module.decode.p25.message.tdu.lc.StatusUpdate; +import io.github.dsheirer.module.decode.p25.message.tdu.lc.TDULinkControlMessage; +import io.github.dsheirer.module.decode.p25.message.tdu.lc.TelephoneInterconnectAnswerRequest; +import io.github.dsheirer.module.decode.p25.message.tdu.lc.TelephoneInterconnectVoiceChannelUser; +import io.github.dsheirer.module.decode.p25.message.tdu.lc.UnitAuthenticationCommand; +import io.github.dsheirer.module.decode.p25.message.tdu.lc.UnitRegistrationCommand; +import io.github.dsheirer.module.decode.p25.message.tdu.lc.UnitToUnitAnswerRequest; +import io.github.dsheirer.module.decode.p25.message.tdu.lc.UnitToUnitVoiceChannelUser; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.MotorolaTSBKMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.PatchGroupAdd; +import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.PatchGroupDelete; +import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.PatchGroupVoiceChannelGrant; +import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.PatchGroupVoiceChannelGrantUpdate; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.AcknowledgeResponse; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.AdjacentStatusBroadcast; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.AuthenticationCommand; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.DenyResponse; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.GroupAffiliationResponse; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.IdentifierUpdate; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.LocationRegistrationResponse; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.NetworkStatusBroadcast; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.ProtectionParameterUpdate; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.QueuedResponse; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.RFSSStatusBroadcast; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.RadioUnitMonitorCommand; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.RoamingAddressCommand; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SecondaryControlChannelBroadcast; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SystemService; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.UnitDeregistrationAcknowledge; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.UnitRegistrationResponse; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.data.GroupDataChannelAnnouncement; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.data.GroupDataChannelAnnouncementExplicit; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.data.GroupDataChannelGrant; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.data.IndividualDataChannelGrant; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.data.SNDCPDataChannelAnnouncementExplicit; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.data.SNDCPDataChannelGrant; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.data.SNDCPDataPageRequest; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.GroupVoiceChannelGrant; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.GroupVoiceChannelGrantUpdate; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.GroupVoiceChannelGrantUpdateExplicit; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.TelephoneInterconnectVoiceChannelGrant; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.TelephoneInterconnectVoiceChannelGrantUpdate; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.UnitToUnitVoiceChannelGrant; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.UnitToUnitVoiceChannelGrantUpdate; +import io.github.dsheirer.module.decode.p25.reference.IPProtocol; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.reference.Response; +import io.github.dsheirer.module.decode.p25.reference.Vendor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -149,14 +151,14 @@ public class P25DecoderState extends DecoderState new DecimalFormat("0.000000"); - private module.decode.p25.message.tsbk.osp.control.NetworkStatusBroadcast mNetworkStatus; + private NetworkStatusBroadcast mNetworkStatus; private NetworkStatusBroadcastExtended mNetworkStatusExtended; private ProtectionParameterBroadcast mProtectionParameterBroadcast; private RFSSStatusBroadcast mRFSSStatusMessage; private RFSSStatusBroadcastExtended mRFSSStatusMessageExtended; private SNDCPDataChannelAnnouncementExplicit mSNDCPDataChannel; - private Set mSecondaryControlChannels = + private Set mSecondaryControlChannels = new TreeSet<>(); private Map mBands = new HashMap<>(); @@ -179,7 +181,7 @@ public class P25DecoderState extends DecoderState private long mCurrentChannelFrequency = 0; private ChannelType mChannelType; - private Modulation mModulation; + private P25Decoder.Modulation mModulation; private boolean mIgnoreDataCalls; private boolean mControlChannelShutdownLogged; @@ -190,7 +192,7 @@ public class P25DecoderState extends DecoderState public P25DecoderState(AliasList aliasList, ChannelType channelType, - Modulation modulation, + P25Decoder.Modulation modulation, boolean ignoreDataCalls) { super(aliasList); @@ -210,7 +212,7 @@ public class P25DecoderState extends DecoderState mToTalkgroupMonitor.addIllegalValue("000000"); } - public Modulation getModulation() + public P25Decoder.Modulation getModulation() { return mModulation; } @@ -418,7 +420,7 @@ public class P25DecoderState extends DecoderState if(mCurrentCallEvent == null) { - mCurrentCallEvent = new P25CallEvent.Builder(CallEventType.CALL) + mCurrentCallEvent = new P25CallEvent.Builder(CallEvent.CallEventType.CALL) .aliasList(getAliasList()) .channel(mCurrentChannel) .details((hdu.isEncryptedAudio() ? "ENCRYPTED " : "")) @@ -480,12 +482,12 @@ public class P25DecoderState extends DecoderState } break; case CALL_ALERT: - if(tdulc instanceof module.decode.p25.message.tdu.lc.CallAlert) + if(tdulc instanceof CallAlert) { - module.decode.p25.message.tdu.lc.CallAlert ca = - (module.decode.p25.message.tdu.lc.CallAlert)tdulc; + CallAlert ca = + (CallAlert)tdulc; - broadcast(new P25CallEvent.Builder(CallEventType.PAGE) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.PAGE) .aliasList(getAliasList()) .from(ca.getSourceAddress()) .to(ca.getTargetAddress()) @@ -513,12 +515,12 @@ public class P25DecoderState extends DecoderState * inserted into any channels needing frequency band info */ break; case EXTENDED_FUNCTION_COMMAND: - if(tdulc instanceof module.decode.p25.message.tdu.lc.ExtendedFunctionCommand) + if(tdulc instanceof ExtendedFunctionCommand) { - module.decode.p25.message.tdu.lc.ExtendedFunctionCommand efc = - (module.decode.p25.message.tdu.lc.ExtendedFunctionCommand)tdulc; + ExtendedFunctionCommand efc = + (ExtendedFunctionCommand)tdulc; - broadcast(new P25CallEvent.Builder(CallEventType.COMMAND) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.COMMAND) .aliasList(getAliasList()) .to(efc.getTargetAddress()) .details("FUNCTION:" + efc.getExtendedFunction().getLabel() + @@ -531,12 +533,12 @@ public class P25DecoderState extends DecoderState } break; case GROUP_AFFILIATION_QUERY: - if(tdulc instanceof module.decode.p25.message.tdu.lc.GroupAffiliationQuery) + if(tdulc instanceof GroupAffiliationQuery) { - module.decode.p25.message.tdu.lc.GroupAffiliationQuery gaq = - (module.decode.p25.message.tdu.lc.GroupAffiliationQuery)tdulc; + GroupAffiliationQuery gaq = + (GroupAffiliationQuery)tdulc; - broadcast(new P25CallEvent.Builder(CallEventType.QUERY) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.QUERY) .aliasList(getAliasList()) .details("GROUP AFFILIATION QUERY") .from(gaq.getSourceAddress()) @@ -560,7 +562,7 @@ public class P25DecoderState extends DecoderState if(!mCallDetectTalkgroups.contains(groupA)) { - broadcast(new P25CallEvent.Builder(CallEventType.CALL_DETECT) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.CALL_DETECT) .aliasList(getAliasList()) .channel(gvcu.getChannelA()) .details((gvcu.isEncrypted() ? "ENCRYPTED" : "")) @@ -575,7 +577,7 @@ public class P25DecoderState extends DecoderState if(!mCallDetectTalkgroups.contains(groupB)) { - broadcast(new P25CallEvent.Builder(CallEventType.CALL_DETECT) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.CALL_DETECT) .aliasList(getAliasList()) .channel(gvcu.getChannelB()) .details((gvcu.isEncrypted() ? "ENCRYPTED" : "")) @@ -599,7 +601,7 @@ public class P25DecoderState extends DecoderState if(!mCallDetectTalkgroups.contains(group)) { - broadcast(new P25CallEvent.Builder(CallEventType.CALL_DETECT) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.CALL_DETECT) .aliasList(getAliasList()) .channel(gvcue.getTransmitChannel()) .details((gvcue.isEncrypted() ? "ENCRYPTED" : "")) @@ -613,10 +615,10 @@ public class P25DecoderState extends DecoderState break; case GROUP_VOICE_CHANNEL_USER: /* Used on a traffic channel to reflect current call entities */ - if(tdulc instanceof module.decode.p25.message.tdu.lc.GroupVoiceChannelUser) + if(tdulc instanceof GroupVoiceChannelUser) { - module.decode.p25.message.tdu.lc.GroupVoiceChannelUser gvcuser = - (module.decode.p25.message.tdu.lc.GroupVoiceChannelUser)tdulc; + GroupVoiceChannelUser gvcuser = + (GroupVoiceChannelUser)tdulc; broadcast(new DecoderStateEvent(this, Event.CONTINUATION, State.CALL)); @@ -628,7 +630,7 @@ public class P25DecoderState extends DecoderState if(mCurrentCallEvent == null) { - mCurrentCallEvent = new P25CallEvent.Builder(CallEventType.GROUP_CALL) + mCurrentCallEvent = new P25CallEvent.Builder(CallEvent.CallEventType.GROUP_CALL) .aliasList(getAliasList()) .channel(mCurrentChannel) .details("TDULC GROUP VOICE CHANNEL USER" + @@ -644,12 +646,12 @@ public class P25DecoderState extends DecoderState } break; case MESSAGE_UPDATE: - if(tdulc instanceof module.decode.p25.message.tdu.lc.MessageUpdate) + if(tdulc instanceof MessageUpdate) { - module.decode.p25.message.tdu.lc.MessageUpdate mu = - (module.decode.p25.message.tdu.lc.MessageUpdate)tdulc; + MessageUpdate mu = + (MessageUpdate)tdulc; - broadcast(new P25CallEvent.Builder(CallEventType.SDM) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.SDM) .aliasList(getAliasList()) .from(mu.getSourceAddress()) .to(mu.getTargetAddress()) @@ -662,9 +664,9 @@ public class P25DecoderState extends DecoderState } break; case NETWORK_STATUS_BROADCAST: - if(tdulc instanceof NetworkStatusBroadcast) + if(tdulc instanceof io.github.dsheirer.module.decode.p25.message.tdu.lc.NetworkStatusBroadcast) { - updateSystem(((NetworkStatusBroadcast)tdulc).getSystem()); + updateSystem(((io.github.dsheirer.module.decode.p25.message.tdu.lc.NetworkStatusBroadcast)tdulc).getSystem()); } else { @@ -682,12 +684,12 @@ public class P25DecoderState extends DecoderState } break; case PROTECTION_PARAMETER_BROADCAST: - if(tdulc instanceof module.decode.p25.message.tdu.lc.ProtectionParameterBroadcast) + if(tdulc instanceof io.github.dsheirer.module.decode.p25.message.tdu.lc.ProtectionParameterBroadcast) { - module.decode.p25.message.tdu.lc.ProtectionParameterBroadcast ppb = - (module.decode.p25.message.tdu.lc.ProtectionParameterBroadcast)tdulc; + io.github.dsheirer.module.decode.p25.message.tdu.lc.ProtectionParameterBroadcast ppb = + (io.github.dsheirer.module.decode.p25.message.tdu.lc.ProtectionParameterBroadcast)tdulc; - broadcast(new P25CallEvent.Builder(CallEventType.COMMAND) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.COMMAND) .aliasList(getAliasList()) .to(ppb.getTargetAddress()) .details("ENCRYPTION: " + @@ -701,10 +703,10 @@ public class P25DecoderState extends DecoderState } break; case RFSS_STATUS_BROADCAST: - if(tdulc instanceof module.decode.p25.message.tdu.lc.RFSSStatusBroadcast) + if(tdulc instanceof io.github.dsheirer.module.decode.p25.message.tdu.lc.RFSSStatusBroadcast) { - module.decode.p25.message.tdu.lc.RFSSStatusBroadcast rfsssb = - (module.decode.p25.message.tdu.lc.RFSSStatusBroadcast)tdulc; + io.github.dsheirer.module.decode.p25.message.tdu.lc.RFSSStatusBroadcast rfsssb = + (io.github.dsheirer.module.decode.p25.message.tdu.lc.RFSSStatusBroadcast)tdulc; updateSystem(rfsssb.getSystem()); @@ -726,10 +728,10 @@ public class P25DecoderState extends DecoderState } break; case RFSS_STATUS_BROADCAST_EXPLICIT: - if(tdulc instanceof module.decode.p25.message.tdu.lc.RFSSStatusBroadcastExplicit) + if(tdulc instanceof RFSSStatusBroadcastExplicit) { - module.decode.p25.message.tdu.lc.RFSSStatusBroadcastExplicit rfsssbe = - (module.decode.p25.message.tdu.lc.RFSSStatusBroadcastExplicit)tdulc; + RFSSStatusBroadcastExplicit rfsssbe = + (RFSSStatusBroadcastExplicit)tdulc; String site = rfsssbe.getRFSubsystemID() + "-" + rfsssbe.getSiteID(); @@ -749,10 +751,10 @@ public class P25DecoderState extends DecoderState } break; case SECONDARY_CONTROL_CHANNEL_BROADCAST: - if(tdulc instanceof SecondaryControlChannelBroadcast) + if(tdulc instanceof io.github.dsheirer.module.decode.p25.message.tdu.lc.SecondaryControlChannelBroadcast) { - SecondaryControlChannelBroadcast sccb = - (SecondaryControlChannelBroadcast)tdulc; + io.github.dsheirer.module.decode.p25.message.tdu.lc.SecondaryControlChannelBroadcast sccb = + (io.github.dsheirer.module.decode.p25.message.tdu.lc.SecondaryControlChannelBroadcast)tdulc; String site = sccb.getRFSubsystemID() + "-" + sccb.getSiteID(); @@ -781,12 +783,12 @@ public class P25DecoderState extends DecoderState } break; case STATUS_QUERY: - if(tdulc instanceof module.decode.p25.message.tdu.lc.StatusQuery) + if(tdulc instanceof StatusQuery) { - module.decode.p25.message.tdu.lc.StatusQuery sq = - (module.decode.p25.message.tdu.lc.StatusQuery)tdulc; + StatusQuery sq = + (StatusQuery)tdulc; - broadcast(new P25CallEvent.Builder(CallEventType.QUERY) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.QUERY) .aliasList(getAliasList()) .details("STATUS QUERY") .from(sq.getSourceAddress()) @@ -799,12 +801,11 @@ public class P25DecoderState extends DecoderState } break; case STATUS_UPDATE: - if(tdulc instanceof module.decode.p25.message.tdu.lc.StatusUpdate) + if(tdulc instanceof StatusUpdate) { - module.decode.p25.message.tdu.lc.StatusUpdate su = - (module.decode.p25.message.tdu.lc.StatusUpdate)tdulc; + StatusUpdate su = (StatusUpdate)tdulc; - broadcast(new P25CallEvent.Builder(CallEventType.STATUS) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.STATUS) .aliasList(getAliasList()) .details("STATUS UNIT:" + su.getUnitStatus() + " USER:" + su.getUserStatus()) @@ -821,12 +822,12 @@ public class P25DecoderState extends DecoderState /* This message doesn't provide anything we need for channel state */ break; case TELEPHONE_INTERCONNECT_ANSWER_REQUEST: - if(tdulc instanceof module.decode.p25.message.tdu.lc.TelephoneInterconnectAnswerRequest) + if(tdulc instanceof TelephoneInterconnectAnswerRequest) { - module.decode.p25.message.tdu.lc.TelephoneInterconnectAnswerRequest tiar = - (module.decode.p25.message.tdu.lc.TelephoneInterconnectAnswerRequest)tdulc; + TelephoneInterconnectAnswerRequest tiar = + (TelephoneInterconnectAnswerRequest)tdulc; - broadcast(new P25CallEvent.Builder(CallEventType.PAGE) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.PAGE) .aliasList(getAliasList()) .from(tiar.getTelephoneNumber()) .to(tiar.getTargetAddress()) @@ -840,10 +841,10 @@ public class P25DecoderState extends DecoderState break; case TELEPHONE_INTERCONNECT_VOICE_CHANNEL_USER: if(mChannelType == ChannelType.STANDARD && - tdulc instanceof module.decode.p25.message.tdu.lc.TelephoneInterconnectVoiceChannelUser) + tdulc instanceof TelephoneInterconnectVoiceChannelUser) { - module.decode.p25.message.tdu.lc.TelephoneInterconnectVoiceChannelUser tivcu = - (module.decode.p25.message.tdu.lc.TelephoneInterconnectVoiceChannelUser)tdulc; + TelephoneInterconnectVoiceChannelUser tivcu = + (TelephoneInterconnectVoiceChannelUser)tdulc; String to = tivcu.getAddress(); @@ -851,7 +852,7 @@ public class P25DecoderState extends DecoderState if(mCurrentCallEvent == null) { - mCurrentCallEvent = new P25CallEvent.Builder(CallEventType.TELEPHONE_INTERCONNECT) + mCurrentCallEvent = new P25CallEvent.Builder(CallEvent.CallEventType.TELEPHONE_INTERCONNECT) .aliasList(getAliasList()) .channel(mCurrentChannel) .details((tivcu.isEncrypted() ? "ENCRYPTED" : "") + @@ -865,12 +866,12 @@ public class P25DecoderState extends DecoderState } break; case UNIT_AUTHENTICATION_COMMAND: - if(tdulc instanceof module.decode.p25.message.tdu.lc.UnitAuthenticationCommand) + if(tdulc instanceof UnitAuthenticationCommand) { - module.decode.p25.message.tdu.lc.UnitAuthenticationCommand uac = - (module.decode.p25.message.tdu.lc.UnitAuthenticationCommand)tdulc; + UnitAuthenticationCommand uac = + (UnitAuthenticationCommand)tdulc; - broadcast(new P25CallEvent.Builder(CallEventType.COMMAND) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.COMMAND) .aliasList(getAliasList()) .to(uac.getCompleteTargetAddress()) .details("AUTHENTICATE") @@ -882,12 +883,12 @@ public class P25DecoderState extends DecoderState } break; case UNIT_REGISTRATION_COMMAND: - if(tdulc instanceof module.decode.p25.message.tdu.lc.UnitRegistrationCommand) + if(tdulc instanceof UnitRegistrationCommand) { - module.decode.p25.message.tdu.lc.UnitRegistrationCommand urc = - (module.decode.p25.message.tdu.lc.UnitRegistrationCommand)tdulc; + UnitRegistrationCommand urc = + (UnitRegistrationCommand)tdulc; - broadcast(new P25CallEvent.Builder(CallEventType.COMMAND) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.COMMAND) .aliasList(getAliasList()) .to(urc.getCompleteTargetAddress()) .details("REGISTER") @@ -899,12 +900,12 @@ public class P25DecoderState extends DecoderState } break; case UNIT_TO_UNIT_ANSWER_REQUEST: - if(tdulc instanceof module.decode.p25.message.tdu.lc.UnitToUnitAnswerRequest) + if(tdulc instanceof UnitToUnitAnswerRequest) { - module.decode.p25.message.tdu.lc.UnitToUnitAnswerRequest uuar = - (module.decode.p25.message.tdu.lc.UnitToUnitAnswerRequest)tdulc; + UnitToUnitAnswerRequest uuar = + (UnitToUnitAnswerRequest)tdulc; - broadcast(new P25CallEvent.Builder(CallEventType.PAGE) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.PAGE) .aliasList(getAliasList()) .from(uuar.getSourceAddress()) .to(uuar.getTargetAddress()) @@ -918,10 +919,10 @@ public class P25DecoderState extends DecoderState break; case UNIT_TO_UNIT_VOICE_CHANNEL_USER: /* Used on traffic channels to indicate the current call entities */ - if(tdulc instanceof module.decode.p25.message.tdu.lc.UnitToUnitVoiceChannelUser) + if(tdulc instanceof UnitToUnitVoiceChannelUser) { - module.decode.p25.message.tdu.lc.UnitToUnitVoiceChannelUser uuvcu = - (module.decode.p25.message.tdu.lc.UnitToUnitVoiceChannelUser)tdulc; + UnitToUnitVoiceChannelUser uuvcu = + (UnitToUnitVoiceChannelUser)tdulc; String from = uuvcu.getSourceAddress(); mFromTalkgroupMonitor.process(from); @@ -931,7 +932,7 @@ public class P25DecoderState extends DecoderState if(mCurrentCallEvent != null) { - mCurrentCallEvent = new P25CallEvent.Builder(CallEventType.UNIT_TO_UNIT_CALL) + mCurrentCallEvent = new P25CallEvent.Builder(CallEvent.CallEventType.UNIT_TO_UNIT_CALL) .aliasList(getAliasList()) .channel(mCurrentChannel) .details((uuvcu.isEncrypted() ? "ENCRYPTED " : "") + @@ -974,7 +975,7 @@ public class P25DecoderState extends DecoderState if(mCurrentCallEvent == null) { - mCurrentCallEvent = new P25CallEvent.Builder(CallEventType.CALL) + mCurrentCallEvent = new P25CallEvent.Builder(CallEvent.CallEventType.CALL) .aliasList(getAliasList()) .channel(mCurrentChannel) .frequency(mCurrentChannelFrequency) @@ -988,7 +989,7 @@ public class P25DecoderState extends DecoderState switch(((LDU1Message)ldu).getOpcode()) { case ADJACENT_SITE_STATUS_BROADCAST: - if(ldu instanceof module.decode.p25.message.ldu.lc.AdjacentSiteStatusBroadcast) + if(ldu instanceof io.github.dsheirer.module.decode.p25.message.ldu.lc.AdjacentSiteStatusBroadcast) { IAdjacentSite ias = (IAdjacentSite)ldu; @@ -1003,7 +1004,7 @@ public class P25DecoderState extends DecoderState break; case ADJACENT_SITE_STATUS_BROADCAST_EXPLICIT: - if(ldu instanceof module.decode.p25.message.ldu.lc.AdjacentSiteStatusBroadcastExplicit) + if(ldu instanceof io.github.dsheirer.module.decode.p25.message.ldu.lc.AdjacentSiteStatusBroadcastExplicit) { IAdjacentSite ias = (IAdjacentSite)ldu; @@ -1017,11 +1018,11 @@ public class P25DecoderState extends DecoderState } break; case CALL_ALERT: - if(ldu instanceof module.decode.p25.message.ldu.lc.CallAlert) + if(ldu instanceof io.github.dsheirer.module.decode.p25.message.ldu.lc.CallAlert) { - module.decode.p25.message.ldu.lc.CallAlert ca = - (module.decode.p25.message.ldu.lc.CallAlert)ldu; - broadcast(new P25CallEvent.Builder(CallEventType.PAGE) + io.github.dsheirer.module.decode.p25.message.ldu.lc.CallAlert ca = + (io.github.dsheirer.module.decode.p25.message.ldu.lc.CallAlert)ldu; + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.PAGE) .aliasList(getAliasList()) .from(ca.getSourceAddress()) .to(ca.getTargetAddress()) @@ -1055,12 +1056,12 @@ public class P25DecoderState extends DecoderState * inserted into any channels needing frequency band info */ break; case EXTENDED_FUNCTION_COMMAND: - if(ldu instanceof module.decode.p25.message.ldu.lc.ExtendedFunctionCommand) + if(ldu instanceof io.github.dsheirer.module.decode.p25.message.ldu.lc.ExtendedFunctionCommand) { - module.decode.p25.message.ldu.lc.ExtendedFunctionCommand efc = - (module.decode.p25.message.ldu.lc.ExtendedFunctionCommand)ldu; + io.github.dsheirer.module.decode.p25.message.ldu.lc.ExtendedFunctionCommand efc = + (io.github.dsheirer.module.decode.p25.message.ldu.lc.ExtendedFunctionCommand)ldu; - broadcast(new P25CallEvent.Builder(CallEventType.COMMAND) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.COMMAND) .aliasList(getAliasList()) .to(efc.getTargetAddress()) .details("FUNCTION:" + efc.getExtendedFunction().getLabel() + @@ -1074,12 +1075,12 @@ public class P25DecoderState extends DecoderState break; case GROUP_AFFILIATION_QUERY: if(mChannelType == ChannelType.STANDARD && - ldu instanceof module.decode.p25.message.ldu.lc.GroupAffiliationQuery) + ldu instanceof io.github.dsheirer.module.decode.p25.message.ldu.lc.GroupAffiliationQuery) { - module.decode.p25.message.ldu.lc.GroupAffiliationQuery gaq = - (module.decode.p25.message.ldu.lc.GroupAffiliationQuery)ldu; + io.github.dsheirer.module.decode.p25.message.ldu.lc.GroupAffiliationQuery gaq = + (io.github.dsheirer.module.decode.p25.message.ldu.lc.GroupAffiliationQuery)ldu; - broadcast(new P25CallEvent.Builder(CallEventType.QUERY) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.QUERY) .aliasList(getAliasList()) .details("GROUP AFFILIATION QUERY") .from(gaq.getSourceAddress()) @@ -1092,10 +1093,10 @@ public class P25DecoderState extends DecoderState } break; case GROUP_VOICE_CHANNEL_UPDATE: - if(ldu instanceof module.decode.p25.message.ldu.lc.GroupVoiceChannelUpdate) + if(ldu instanceof io.github.dsheirer.module.decode.p25.message.ldu.lc.GroupVoiceChannelUpdate) { - module.decode.p25.message.ldu.lc.GroupVoiceChannelUpdate gvcu = - (module.decode.p25.message.ldu.lc.GroupVoiceChannelUpdate)ldu; + io.github.dsheirer.module.decode.p25.message.ldu.lc.GroupVoiceChannelUpdate gvcu = + (io.github.dsheirer.module.decode.p25.message.ldu.lc.GroupVoiceChannelUpdate)ldu; String userA = gvcu.getGroupAddressA(); String userB = gvcu.getGroupAddressB(); @@ -1104,7 +1105,7 @@ public class P25DecoderState extends DecoderState { if(!mCallDetectTalkgroups.contains(userA)) { - broadcast(new P25CallEvent.Builder(CallEventType.CALL_DETECT) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.CALL_DETECT) .aliasList(getAliasList()) .channel(gvcu.getChannelA()) .details((gvcu.isEncryptedLinkControlWord() ? "ENCRYPTED" : "")) @@ -1119,7 +1120,7 @@ public class P25DecoderState extends DecoderState !userB.contentEquals("0000") && !mCallDetectTalkgroups.contains(userB)) { - broadcast(new P25CallEvent.Builder(CallEventType.CALL_DETECT) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.CALL_DETECT) .aliasList(getAliasList()) .channel(gvcu.getChannelB()) .details((gvcu.isEncryptedLinkControlWord() ? "ENCRYPTED" : "")) @@ -1137,10 +1138,10 @@ public class P25DecoderState extends DecoderState } break; case GROUP_VOICE_CHANNEL_UPDATE_EXPLICIT: - if(ldu instanceof module.decode.p25.message.ldu.lc.GroupVoiceChannelUpdateExplicit) + if(ldu instanceof io.github.dsheirer.module.decode.p25.message.ldu.lc.GroupVoiceChannelUpdateExplicit) { - module.decode.p25.message.ldu.lc.GroupVoiceChannelUpdateExplicit gvcue = - (module.decode.p25.message.ldu.lc.GroupVoiceChannelUpdateExplicit)ldu; + io.github.dsheirer.module.decode.p25.message.ldu.lc.GroupVoiceChannelUpdateExplicit gvcue = + (io.github.dsheirer.module.decode.p25.message.ldu.lc.GroupVoiceChannelUpdateExplicit)ldu; String group = gvcue.getGroupAddress(); @@ -1148,7 +1149,7 @@ public class P25DecoderState extends DecoderState { if(!mCallDetectTalkgroups.contains(group)) { - broadcast(new P25CallEvent.Builder(CallEventType.CALL_DETECT) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.CALL_DETECT) .aliasList(getAliasList()) .channel(gvcue.getTransmitChannel()) .details((gvcue.isEncryptedLinkControlWord() ? "ENCRYPTED" : "")) @@ -1167,10 +1168,10 @@ public class P25DecoderState extends DecoderState break; case GROUP_VOICE_CHANNEL_USER: /* Indicates the current user of the current channel */ - if(ldu instanceof module.decode.p25.message.ldu.lc.GroupVoiceChannelUser) + if(ldu instanceof io.github.dsheirer.module.decode.p25.message.ldu.lc.GroupVoiceChannelUser) { - module.decode.p25.message.ldu.lc.GroupVoiceChannelUser gvcuser = - (module.decode.p25.message.ldu.lc.GroupVoiceChannelUser)ldu; + io.github.dsheirer.module.decode.p25.message.ldu.lc.GroupVoiceChannelUser gvcuser = + (io.github.dsheirer.module.decode.p25.message.ldu.lc.GroupVoiceChannelUser)ldu; mFromTalkgroupMonitor.process(gvcuser.getSourceAddress()); @@ -1178,9 +1179,9 @@ public class P25DecoderState extends DecoderState if(mChannelType == ChannelType.STANDARD) { - if(mCurrentCallEvent.getCallEventType() != CallEventType.GROUP_CALL) + if(mCurrentCallEvent.getCallEventType() != CallEvent.CallEventType.GROUP_CALL) { - mCurrentCallEvent.setCallEventType(CallEventType.GROUP_CALL); + mCurrentCallEvent.setCallEventType(CallEvent.CallEventType.GROUP_CALL); broadcast(mCurrentCallEvent); } @@ -1200,12 +1201,12 @@ public class P25DecoderState extends DecoderState } break; case MESSAGE_UPDATE: - if(ldu instanceof module.decode.p25.message.ldu.lc.MessageUpdate) + if(ldu instanceof io.github.dsheirer.module.decode.p25.message.ldu.lc.MessageUpdate) { - module.decode.p25.message.ldu.lc.MessageUpdate mu = - (module.decode.p25.message.ldu.lc.MessageUpdate)ldu; + io.github.dsheirer.module.decode.p25.message.ldu.lc.MessageUpdate mu = + (io.github.dsheirer.module.decode.p25.message.ldu.lc.MessageUpdate)ldu; - broadcast(new P25CallEvent.Builder(CallEventType.SDM) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.SDM) .aliasList(getAliasList()) .from(mu.getSourceAddress()) .to(mu.getTargetAddress()) @@ -1218,9 +1219,9 @@ public class P25DecoderState extends DecoderState } break; case NETWORK_STATUS_BROADCAST: - if(ldu instanceof module.decode.p25.message.ldu.lc.NetworkStatusBroadcast) + if(ldu instanceof io.github.dsheirer.module.decode.p25.message.ldu.lc.NetworkStatusBroadcast) { - updateSystem(((module.decode.p25.message.ldu.lc.NetworkStatusBroadcast)ldu).getSystem()); + updateSystem(((io.github.dsheirer.module.decode.p25.message.ldu.lc.NetworkStatusBroadcast)ldu).getSystem()); } else { @@ -1228,9 +1229,9 @@ public class P25DecoderState extends DecoderState } break; case NETWORK_STATUS_BROADCAST_EXPLICIT: - if(ldu instanceof module.decode.p25.message.ldu.lc.NetworkStatusBroadcastExplicit) + if(ldu instanceof io.github.dsheirer.module.decode.p25.message.ldu.lc.NetworkStatusBroadcastExplicit) { - updateSystem(((module.decode.p25.message.ldu.lc.NetworkStatusBroadcastExplicit)ldu).getSystem()); + updateSystem(((io.github.dsheirer.module.decode.p25.message.ldu.lc.NetworkStatusBroadcastExplicit)ldu).getSystem()); } else { @@ -1238,12 +1239,12 @@ public class P25DecoderState extends DecoderState } break; case PROTECTION_PARAMETER_BROADCAST: - if(ldu instanceof module.decode.p25.message.ldu.lc.ProtectionParameterBroadcast) + if(ldu instanceof io.github.dsheirer.module.decode.p25.message.ldu.lc.ProtectionParameterBroadcast) { - module.decode.p25.message.ldu.lc.ProtectionParameterBroadcast ppb = - (module.decode.p25.message.ldu.lc.ProtectionParameterBroadcast)ldu; + io.github.dsheirer.module.decode.p25.message.ldu.lc.ProtectionParameterBroadcast ppb = + (io.github.dsheirer.module.decode.p25.message.ldu.lc.ProtectionParameterBroadcast)ldu; - broadcast(new P25CallEvent.Builder(CallEventType.COMMAND) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.COMMAND) .aliasList(getAliasList()) .to(ppb.getTargetAddress()) .details("ENCRYPTION: " + @@ -1257,10 +1258,10 @@ public class P25DecoderState extends DecoderState } break; case RFSS_STATUS_BROADCAST: - if(ldu instanceof module.decode.p25.message.ldu.lc.RFSSStatusBroadcast) + if(ldu instanceof io.github.dsheirer.module.decode.p25.message.ldu.lc.RFSSStatusBroadcast) { - module.decode.p25.message.ldu.lc.RFSSStatusBroadcast rfsssb = - (module.decode.p25.message.ldu.lc.RFSSStatusBroadcast)ldu; + io.github.dsheirer.module.decode.p25.message.ldu.lc.RFSSStatusBroadcast rfsssb = + (io.github.dsheirer.module.decode.p25.message.ldu.lc.RFSSStatusBroadcast)ldu; updateSystem(rfsssb.getSystem()); @@ -1275,10 +1276,10 @@ public class P25DecoderState extends DecoderState } break; case RFSS_STATUS_BROADCAST_EXPLICIT: - if(ldu instanceof module.decode.p25.message.ldu.lc.RFSSStatusBroadcastExplicit) + if(ldu instanceof io.github.dsheirer.module.decode.p25.message.ldu.lc.RFSSStatusBroadcastExplicit) { - module.decode.p25.message.ldu.lc.RFSSStatusBroadcastExplicit rfsssbe = - (module.decode.p25.message.ldu.lc.RFSSStatusBroadcastExplicit)ldu; + io.github.dsheirer.module.decode.p25.message.ldu.lc.RFSSStatusBroadcastExplicit rfsssbe = + (io.github.dsheirer.module.decode.p25.message.ldu.lc.RFSSStatusBroadcastExplicit)ldu; String site = rfsssbe.getRFSubsystemID() + "-" + rfsssbe.getSiteID(); @@ -1291,10 +1292,10 @@ public class P25DecoderState extends DecoderState } break; case SECONDARY_CONTROL_CHANNEL_BROADCAST: - if(ldu instanceof module.decode.p25.message.ldu.lc.SecondaryControlChannelBroadcast) + if(ldu instanceof io.github.dsheirer.module.decode.p25.message.ldu.lc.SecondaryControlChannelBroadcast) { - module.decode.p25.message.ldu.lc.SecondaryControlChannelBroadcast sccb = - (module.decode.p25.message.ldu.lc.SecondaryControlChannelBroadcast)ldu; + io.github.dsheirer.module.decode.p25.message.ldu.lc.SecondaryControlChannelBroadcast sccb = + (io.github.dsheirer.module.decode.p25.message.ldu.lc.SecondaryControlChannelBroadcast)ldu; String site = sccb.getRFSubsystemID() + "-" + sccb.getSiteID(); @@ -1307,10 +1308,10 @@ public class P25DecoderState extends DecoderState } break; case SECONDARY_CONTROL_CHANNEL_BROADCAST_EXPLICIT: - if(ldu instanceof module.decode.p25.message.ldu.lc.SecondaryControlChannelBroadcastExplicit) + if(ldu instanceof io.github.dsheirer.module.decode.p25.message.ldu.lc.SecondaryControlChannelBroadcastExplicit) { - module.decode.p25.message.ldu.lc.SecondaryControlChannelBroadcastExplicit sccb = - (module.decode.p25.message.ldu.lc.SecondaryControlChannelBroadcastExplicit)ldu; + io.github.dsheirer.module.decode.p25.message.ldu.lc.SecondaryControlChannelBroadcastExplicit sccb = + (io.github.dsheirer.module.decode.p25.message.ldu.lc.SecondaryControlChannelBroadcastExplicit)ldu; String site = sccb.getRFSubsystemID() + "-" + sccb.getSiteID(); @@ -1323,12 +1324,12 @@ public class P25DecoderState extends DecoderState } break; case STATUS_QUERY: - if(ldu instanceof module.decode.p25.message.ldu.lc.StatusQuery) + if(ldu instanceof io.github.dsheirer.module.decode.p25.message.ldu.lc.StatusQuery) { - module.decode.p25.message.ldu.lc.StatusQuery sq = - (module.decode.p25.message.ldu.lc.StatusQuery)ldu; + io.github.dsheirer.module.decode.p25.message.ldu.lc.StatusQuery sq = + (io.github.dsheirer.module.decode.p25.message.ldu.lc.StatusQuery)ldu; - broadcast(new P25CallEvent.Builder(CallEventType.QUERY) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.QUERY) .aliasList(getAliasList()) .details("STATUS QUERY") .from(sq.getSourceAddress()) @@ -1341,12 +1342,12 @@ public class P25DecoderState extends DecoderState } break; case STATUS_UPDATE: - if(ldu instanceof module.decode.p25.message.ldu.lc.StatusUpdate) + if(ldu instanceof io.github.dsheirer.module.decode.p25.message.ldu.lc.StatusUpdate) { - module.decode.p25.message.ldu.lc.StatusUpdate su = - (module.decode.p25.message.ldu.lc.StatusUpdate)ldu; + io.github.dsheirer.module.decode.p25.message.ldu.lc.StatusUpdate su = + (io.github.dsheirer.module.decode.p25.message.ldu.lc.StatusUpdate)ldu; - broadcast(new P25CallEvent.Builder(CallEventType.STATUS) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.STATUS) .aliasList(getAliasList()) .details("STATUS UNIT:" + su.getUnitStatus() + " USER:" + su.getUserStatus()) @@ -1363,12 +1364,12 @@ public class P25DecoderState extends DecoderState /* This message doesn't provide anything we need for channel state */ break; case TELEPHONE_INTERCONNECT_ANSWER_REQUEST: - if(ldu instanceof module.decode.p25.message.ldu.lc.TelephoneInterconnectAnswerRequest) + if(ldu instanceof io.github.dsheirer.module.decode.p25.message.ldu.lc.TelephoneInterconnectAnswerRequest) { - module.decode.p25.message.ldu.lc.TelephoneInterconnectAnswerRequest tiar = - (module.decode.p25.message.ldu.lc.TelephoneInterconnectAnswerRequest)ldu; + io.github.dsheirer.module.decode.p25.message.ldu.lc.TelephoneInterconnectAnswerRequest tiar = + (io.github.dsheirer.module.decode.p25.message.ldu.lc.TelephoneInterconnectAnswerRequest)ldu; - broadcast(new P25CallEvent.Builder(CallEventType.PAGE) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.PAGE) .aliasList(getAliasList()) .from(tiar.getTelephoneNumber()) .to(tiar.getTargetAddress()) @@ -1383,16 +1384,16 @@ public class P25DecoderState extends DecoderState case TELEPHONE_INTERCONNECT_VOICE_CHANNEL_USER: /* Indicates the current user of the current channel */ if(mChannelType == ChannelType.STANDARD && - ldu instanceof TelephoneInterconnectVoiceChannelUser) + ldu instanceof io.github.dsheirer.module.decode.p25.message.ldu.lc.TelephoneInterconnectVoiceChannelUser) { - TelephoneInterconnectVoiceChannelUser tivcu = - (TelephoneInterconnectVoiceChannelUser)ldu; + io.github.dsheirer.module.decode.p25.message.ldu.lc.TelephoneInterconnectVoiceChannelUser tivcu = + (io.github.dsheirer.module.decode.p25.message.ldu.lc.TelephoneInterconnectVoiceChannelUser)ldu; mToTalkgroupMonitor.process(tivcu.getAddress()); - if(mCurrentCallEvent.getCallEventType() != CallEventType.TELEPHONE_INTERCONNECT) + if(mCurrentCallEvent.getCallEventType() != CallEvent.CallEventType.TELEPHONE_INTERCONNECT) { - mCurrentCallEvent.setCallEventType(CallEventType.TELEPHONE_INTERCONNECT); + mCurrentCallEvent.setCallEventType(CallEvent.CallEventType.TELEPHONE_INTERCONNECT); broadcast(mCurrentCallEvent); } @@ -1411,12 +1412,12 @@ public class P25DecoderState extends DecoderState } break; case UNIT_AUTHENTICATION_COMMAND: - if(ldu instanceof module.decode.p25.message.ldu.lc.UnitAuthenticationCommand) + if(ldu instanceof io.github.dsheirer.module.decode.p25.message.ldu.lc.UnitAuthenticationCommand) { - module.decode.p25.message.ldu.lc.UnitAuthenticationCommand uac = - (module.decode.p25.message.ldu.lc.UnitAuthenticationCommand)ldu; + io.github.dsheirer.module.decode.p25.message.ldu.lc.UnitAuthenticationCommand uac = + (io.github.dsheirer.module.decode.p25.message.ldu.lc.UnitAuthenticationCommand)ldu; - broadcast(new P25CallEvent.Builder(CallEventType.COMMAND) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.COMMAND) .aliasList(getAliasList()) .to(uac.getCompleteTargetAddress()) .details("AUTHENTICATE") @@ -1428,12 +1429,12 @@ public class P25DecoderState extends DecoderState } break; case UNIT_REGISTRATION_COMMAND: - if(ldu instanceof module.decode.p25.message.ldu.lc.UnitRegistrationCommand) + if(ldu instanceof io.github.dsheirer.module.decode.p25.message.ldu.lc.UnitRegistrationCommand) { - module.decode.p25.message.ldu.lc.UnitRegistrationCommand urc = - (module.decode.p25.message.ldu.lc.UnitRegistrationCommand)ldu; + io.github.dsheirer.module.decode.p25.message.ldu.lc.UnitRegistrationCommand urc = + (io.github.dsheirer.module.decode.p25.message.ldu.lc.UnitRegistrationCommand)ldu; - broadcast(new P25CallEvent.Builder(CallEventType.COMMAND) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.COMMAND) .aliasList(getAliasList()) .to(urc.getCompleteTargetAddress()) .details("REGISTER") @@ -1445,12 +1446,12 @@ public class P25DecoderState extends DecoderState } break; case UNIT_TO_UNIT_ANSWER_REQUEST: - if(ldu instanceof module.decode.p25.message.ldu.lc.UnitToUnitAnswerRequest) + if(ldu instanceof io.github.dsheirer.module.decode.p25.message.ldu.lc.UnitToUnitAnswerRequest) { - module.decode.p25.message.ldu.lc.UnitToUnitAnswerRequest uuar = - (module.decode.p25.message.ldu.lc.UnitToUnitAnswerRequest)ldu; + io.github.dsheirer.module.decode.p25.message.ldu.lc.UnitToUnitAnswerRequest uuar = + (io.github.dsheirer.module.decode.p25.message.ldu.lc.UnitToUnitAnswerRequest)ldu; - broadcast(new P25CallEvent.Builder(CallEventType.PAGE) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.PAGE) .aliasList(getAliasList()) .from(uuar.getSourceAddress()) .to(uuar.getTargetAddress()) @@ -1464,18 +1465,18 @@ public class P25DecoderState extends DecoderState break; case UNIT_TO_UNIT_VOICE_CHANNEL_USER: if(mChannelType == ChannelType.STANDARD && - ldu instanceof UnitToUnitVoiceChannelUser) + ldu instanceof io.github.dsheirer.module.decode.p25.message.ldu.lc.UnitToUnitVoiceChannelUser) { - UnitToUnitVoiceChannelUser uuvcu = - (UnitToUnitVoiceChannelUser)ldu; + io.github.dsheirer.module.decode.p25.message.ldu.lc.UnitToUnitVoiceChannelUser uuvcu = + (io.github.dsheirer.module.decode.p25.message.ldu.lc.UnitToUnitVoiceChannelUser)ldu; mFromTalkgroupMonitor.process(uuvcu.getSourceAddress()); mToTalkgroupMonitor.process(uuvcu.getTargetAddress()); - if(mCurrentCallEvent.getCallEventType() != CallEventType.UNIT_TO_UNIT_CALL) + if(mCurrentCallEvent.getCallEventType() != CallEvent.CallEventType.UNIT_TO_UNIT_CALL) { - mCurrentCallEvent.setCallEventType(CallEventType.UNIT_TO_UNIT_CALL); + mCurrentCallEvent.setCallEventType(CallEvent.CallEventType.UNIT_TO_UNIT_CALL); broadcast(mCurrentCallEvent); } @@ -1575,8 +1576,7 @@ public class P25DecoderState extends DecoderState processTSBKMessage(tsbk); break; case NETWORK_STATUS_BROADCAST: - mNetworkStatus = (module.decode.p25.message.tsbk.osp - .control.NetworkStatusBroadcast)tsbk; + mNetworkStatus = (NetworkStatusBroadcast)tsbk; break; case PROTECTION_PARAMETER_UPDATE: processTSBKResponse(tsbk); @@ -1594,8 +1594,8 @@ public class P25DecoderState extends DecoderState processTSBKCommand(tsbk); break; case SECONDARY_CONTROL_CHANNEL_BROADCAST: - module.decode.p25.message.tsbk.osp.control.SecondaryControlChannelBroadcast sccb = - (module.decode.p25.message.tsbk.osp.control.SecondaryControlChannelBroadcast)tsbk; + SecondaryControlChannelBroadcast sccb = + (SecondaryControlChannelBroadcast)tsbk; if(sccb.getDownlinkFrequency1() > 0) { @@ -1655,7 +1655,7 @@ public class P25DecoderState extends DecoderState SNDCPActivateTDSContextAccept satca = (SNDCPActivateTDSContextAccept)pduc; - broadcast(new P25CallEvent.Builder(CallEventType.COMMAND) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.COMMAND) .aliasList(getAliasList()) .channel(mCurrentChannel) .details("ACTIVATE SNDCP USE IP:" + satca.getIPAddress()) @@ -1667,7 +1667,7 @@ public class P25DecoderState extends DecoderState SNDCPActivateTDSContextReject satcr = (SNDCPActivateTDSContextReject)pduc; - broadcast(new P25CallEvent.Builder(CallEventType.COMMAND) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.COMMAND) .aliasList(getAliasList()) .channel(mCurrentChannel) .details("REJECT: SNDCP CONTEXT ACTIVATION " @@ -1680,7 +1680,7 @@ public class P25DecoderState extends DecoderState SNDCPActivateTDSContextRequest satcreq = (SNDCPActivateTDSContextRequest)pduc; - broadcast(new P25CallEvent.Builder(CallEventType.QUERY) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.QUERY) .aliasList(getAliasList()) .channel(mCurrentChannel) .details("REQUEST SNDCP USE IP:" + satcreq.getIPAddress()) @@ -1692,7 +1692,7 @@ public class P25DecoderState extends DecoderState SNDCPDeactivateTDSContext sdtca = (SNDCPDeactivateTDSContext)pduc; - broadcast(new P25CallEvent.Builder(CallEventType.QUERY) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.QUERY) .aliasList(getAliasList()) .channel(mCurrentChannel) .details("ACCEPT DEACTIVATE SNDCP CONTEXT") @@ -1704,7 +1704,7 @@ public class P25DecoderState extends DecoderState SNDCPDeactivateTDSContext sdtcreq = (SNDCPDeactivateTDSContext)pduc; - broadcast(new P25CallEvent.Builder(CallEventType.QUERY) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.QUERY) .aliasList(getAliasList()) .channel(mCurrentChannel) .details("REQUEST DEACTIVATE SNDCP CONTEXT") @@ -1733,7 +1733,7 @@ public class P25DecoderState extends DecoderState broadcast(new DecoderStateEvent(this, Event.START, State.DATA)); - broadcast(new P25CallEvent.Builder(CallEventType.DATA_CALL) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.DATA_CALL) .aliasList(getAliasList()) .channel(mCurrentChannel) .details("DATA: " + sud.getPayload() + @@ -1786,7 +1786,7 @@ public class P25DecoderState extends DecoderState { CallAlertExtended ca = (CallAlertExtended)pdu; - broadcast(new P25CallEvent.Builder(CallEventType.PAGE) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.PAGE) .aliasList(getAliasList()) .from(ca.getWACN() + "-" + ca.getSystemID() + "-" + ca.getSourceID()) @@ -1807,7 +1807,7 @@ public class P25DecoderState extends DecoderState if(mLastQueryEventID == null || !gaqe.getTargetAddress() .contentEquals(mLastQueryEventID)) { - broadcast(new P25CallEvent.Builder(CallEventType.QUERY) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.QUERY) .aliasList(getAliasList()) .details("GROUP AFFILIATION") .from(gaqe.getWACN() + "-" + gaqe.getSystemID() + @@ -1828,7 +1828,7 @@ public class P25DecoderState extends DecoderState if(mLastResponseEventID == null || !gar.getTargetAddress() .contentEquals(mLastResponseEventID)) { - broadcast(new P25CallEvent.Builder(CallEventType.RESPONSE) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.RESPONSE) .aliasList(getAliasList()) .details("AFFILIATION:" + gar.getResponse().name() + " FOR GROUP:" + gar.getGroupWACN() + "-" + @@ -1854,7 +1854,7 @@ public class P25DecoderState extends DecoderState { MessageUpdateExtended mu = (MessageUpdateExtended)pdu; - broadcast(new P25CallEvent.Builder(CallEventType.SDM) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.SDM) .aliasList(getAliasList()) .details("MESSAGE: " + mu.getMessage()) .from(mu.getSourceWACN() + "-" + mu.getSourceSystemID() + @@ -1933,7 +1933,7 @@ public class P25DecoderState extends DecoderState sb.append(raue.getWACNG() + "-" + raue.getSystemIDG()); } - broadcast(new P25CallEvent.Builder(CallEventType.RESPONSE) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.RESPONSE) .aliasList(getAliasList()) .details(sb.toString()) .from(raue.getSourceID()) @@ -1953,7 +1953,7 @@ public class P25DecoderState extends DecoderState if(mLastQueryEventID == null || !sq.getTargetAddress() .contentEquals(mLastQueryEventID)) { - broadcast(new P25CallEvent.Builder(CallEventType.QUERY) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.QUERY) .aliasList(getAliasList()) .details("STATUS QUERY") .from(sq.getSourceWACN() + "-" + @@ -1978,7 +1978,7 @@ public class P25DecoderState extends DecoderState if(mLastResponseEventID == null || !mLastResponseEventID .contentEquals(su.getTargetAddress())) { - broadcast(new P25CallEvent.Builder(CallEventType.RESPONSE) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.RESPONSE) .aliasList(getAliasList()) .details("STATUS USER: " + su.getUserStatus() + " UNIT: " + su.getUnitStatus()) @@ -2011,7 +2011,7 @@ public class P25DecoderState extends DecoderState if(mLastRegistrationEventID == null || !mLastRegistrationEventID .contentEquals(urr.getAssignedSourceAddress())) { - broadcast(new P25CallEvent.Builder(CallEventType.REGISTER) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.REGISTER) .aliasList(getAliasList()) .details("REGISTRATION:" + urr.getResponse().name() + " FOR EXTERNAL SYSTEM ADDRESS: " + @@ -2039,7 +2039,7 @@ public class P25DecoderState extends DecoderState if(mLastPageEventID == null || !mLastPageEventID .contentEquals(utuare.getTargetAddress())) { - broadcast(new P25CallEvent.Builder(CallEventType.PAGE) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.PAGE) .aliasList(getAliasList()) .details((utuare.isEmergency() ? "EMERGENCY" : "")) .from(utuare.getWACN() + "-" + @@ -2086,7 +2086,7 @@ public class P25DecoderState extends DecoderState } else { - P25CallEvent callEvent = new P25CallEvent.Builder(CallEventType.DATA_CALL) + P25CallEvent callEvent = new P25CallEvent.Builder(CallEvent.CallEventType.DATA_CALL) .aliasList(getAliasList()) .channel(channel) .details((gdcge.isEncrypted() ? "ENCRYPTED" : "") + @@ -2127,7 +2127,7 @@ public class P25DecoderState extends DecoderState } else { - P25CallEvent callEvent = new P25CallEvent.Builder(CallEventType.GROUP_CALL) + P25CallEvent callEvent = new P25CallEvent.Builder(CallEvent.CallEventType.GROUP_CALL) .aliasList(getAliasList()) .channel(channel) .details((gvcge.isEncrypted() ? "ENCRYPTED" : "") + @@ -2167,7 +2167,7 @@ public class P25DecoderState extends DecoderState } else { - P25CallEvent callEvent = new P25CallEvent.Builder(CallEventType.DATA_CALL) + P25CallEvent callEvent = new P25CallEvent.Builder(CallEvent.CallEventType.DATA_CALL) .aliasList(getAliasList()) .channel(channel) .details((idcge.isEncrypted() ? "ENCRYPTED" : "") + @@ -2209,7 +2209,7 @@ public class P25DecoderState extends DecoderState } else { - P25CallEvent callEvent = new P25CallEvent.Builder(CallEventType.TELEPHONE_INTERCONNECT) + P25CallEvent callEvent = new P25CallEvent.Builder(CallEvent.CallEventType.TELEPHONE_INTERCONNECT) .aliasList(getAliasList()) .channel(channel) .details((ticge.isEncrypted() ? "ENCRYPTED" : "") + @@ -2245,7 +2245,7 @@ public class P25DecoderState extends DecoderState } else { - P25CallEvent callEvent = new P25CallEvent.Builder(CallEventType.UNIT_TO_UNIT_CALL) + P25CallEvent callEvent = new P25CallEvent.Builder(CallEvent.CallEventType.UNIT_TO_UNIT_CALL) .aliasList(getAliasList()) .channel(channel) .details((uuvcge.isEncrypted() ? "ENCRYPTED" : "") + @@ -2285,7 +2285,7 @@ public class P25DecoderState extends DecoderState } else { - P25CallEvent callEvent = new P25CallEvent.Builder(CallEventType.UNIT_TO_UNIT_CALL) + P25CallEvent callEvent = new P25CallEvent.Builder(CallEvent.CallEventType.UNIT_TO_UNIT_CALL) .aliasList(getAliasList()) .channel(channel) .details((uuvcgue.isEncrypted() ? "ENCRYPTED" : "") + @@ -2323,7 +2323,7 @@ public class P25DecoderState extends DecoderState if(mLastCommandEventID == null || !mLastCommandEventID .contentEquals(ac.getFullTargetID())) { - broadcast(new P25CallEvent.Builder(CallEventType.COMMAND) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.COMMAND) .aliasList(getAliasList()) .details("AUTHENTICATE") .to(ac.getWACN() + "-" + ac.getSystemID() + "-" + @@ -2334,12 +2334,12 @@ public class P25DecoderState extends DecoderState } break; case EXTENDED_FUNCTION_COMMAND: - ExtendedFunctionCommand efc = (ExtendedFunctionCommand)message; + io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.ExtendedFunctionCommand efc = (io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.ExtendedFunctionCommand)message; if(mLastCommandEventID == null || !mLastCommandEventID .contentEquals(efc.getTargetAddress())) { - broadcast(new P25CallEvent.Builder(CallEventType.FUNCTION) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.FUNCTION) .aliasList(getAliasList()) .details("EXTENDED FUNCTION: " + efc.getExtendedFunction().getLabel()) @@ -2356,7 +2356,7 @@ public class P25DecoderState extends DecoderState if(mLastCommandEventID == null || !mLastCommandEventID .contentEquals(rumc.getTargetAddress())) { - broadcast(new P25CallEvent.Builder(CallEventType.COMMAND) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.COMMAND) .aliasList(getAliasList()) .details("RADIO UNIT MONITOR") .from(rumc.getSourceAddress()) @@ -2372,7 +2372,7 @@ public class P25DecoderState extends DecoderState if(mLastCommandEventID == null || !mLastCommandEventID .contentEquals(rac.getTargetID())) { - broadcast(new P25CallEvent.Builder(CallEventType.COMMAND) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.COMMAND) .aliasList(getAliasList()) .details(rac.getStackOperation().name() + " ROAMING ADDRESS " + rac.getWACN() + "-" + @@ -2384,12 +2384,12 @@ public class P25DecoderState extends DecoderState } break; case UNIT_REGISTRATION_COMMAND: - UnitRegistrationCommand urc = (UnitRegistrationCommand)message; + io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.UnitRegistrationCommand urc = (io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.UnitRegistrationCommand)message; if(mLastCommandEventID == null || !mLastCommandEventID .contentEquals(urc.getTargetAddress())) { - broadcast(new P25CallEvent.Builder(CallEventType.COMMAND) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.COMMAND) .aliasList(getAliasList()) .details("REGISTER") .from(urc.getSourceAddress()) @@ -2406,9 +2406,9 @@ public class P25DecoderState extends DecoderState private void processTSBKMessage(TSBKMessage message) { - MessageUpdate mu = (MessageUpdate)message; + io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.MessageUpdate mu = (io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.MessageUpdate)message; - broadcast(new P25CallEvent.Builder(CallEventType.SDM) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.SDM) .aliasList(getAliasList()) .details("MESSAGE: " + mu.getMessage()) .from(mu.getSourceAddress()) @@ -2421,12 +2421,12 @@ public class P25DecoderState extends DecoderState switch(message.getOpcode()) { case GROUP_AFFILIATION_QUERY: - GroupAffiliationQuery gaq = (GroupAffiliationQuery)message; + io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.GroupAffiliationQuery gaq = (io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.GroupAffiliationQuery)message; if(mLastQueryEventID == null || !mLastQueryEventID .contentEquals(gaq.getTargetAddress())) { - broadcast(new P25CallEvent.Builder(CallEventType.QUERY) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.QUERY) .aliasList(getAliasList()) .details("GROUP AFFILIATION") .from(gaq.getSourceAddress()) @@ -2435,12 +2435,12 @@ public class P25DecoderState extends DecoderState } break; case STATUS_QUERY: - StatusQuery sq = (StatusQuery)message; + io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.StatusQuery sq = (io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.StatusQuery)message; if(mLastQueryEventID == null || !mLastQueryEventID .contentEquals(sq.getTargetAddress())) { - broadcast(new P25CallEvent.Builder(CallEventType.QUERY) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.QUERY) .aliasList(getAliasList()) .details("STATUS QUERY") .from(sq.getSourceAddress()) @@ -2478,7 +2478,7 @@ public class P25DecoderState extends DecoderState from = ar.getFromID(); } - broadcast(new P25CallEvent.Builder(CallEventType.RESPONSE) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.RESPONSE) .aliasList(getAliasList()) .details("ACKNOWLEDGE") .from(from) @@ -2494,7 +2494,7 @@ public class P25DecoderState extends DecoderState if(mLastResponseEventID == null || !dr.getTargetAddress() .contentEquals(mLastResponseEventID)) { - broadcast(new P25CallEvent.Builder(CallEventType.RESPONSE) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.RESPONSE) .aliasList(getAliasList()) .details("DENY REASON: " + dr.getReason().name() + " REQUESTED: " + dr.getServiceType().name()) @@ -2511,7 +2511,7 @@ public class P25DecoderState extends DecoderState if(mLastResponseEventID == null || !gar.getTargetAddress() .contentEquals(mLastResponseEventID)) { - broadcast(new P25CallEvent.Builder(CallEventType.RESPONSE) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.RESPONSE) .aliasList(getAliasList()) .details("AFFILIATION:" + gar.getResponse().name() + " FOR " + gar.getAffiliationScope() + @@ -2537,7 +2537,7 @@ public class P25DecoderState extends DecoderState if(mLastRegistrationEventID == null || !mLastRegistrationEventID.contentEquals(lrr.getTargetAddress())) { - broadcast(new P25CallEvent.Builder(CallEventType.REGISTER) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.REGISTER) .aliasList(getAliasList()) .details("REGISTRATION:" + lrr.getResponse().name() + " SITE: " + lrr.getRFSSID() + "-" + @@ -2555,7 +2555,7 @@ public class P25DecoderState extends DecoderState if(mLastResponseEventID == null || !ppu.getTargetAddress() .contentEquals(mLastResponseEventID)) { - broadcast(new P25CallEvent.Builder(CallEventType.RESPONSE) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.RESPONSE) .aliasList(getAliasList()) .details("USE ENCRYPTION ALGORITHM:" + ppu.getAlgorithm().name() + " KEY:" + @@ -2572,7 +2572,7 @@ public class P25DecoderState extends DecoderState if(mLastResponseEventID == null || !qr.getTargetAddress() .contentEquals(mLastResponseEventID)) { - broadcast(new P25CallEvent.Builder(CallEventType.RESPONSE) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.RESPONSE) .aliasList(getAliasList()) .details("QUEUED REASON: " + qr.getReason().name() + " REQUESTED: " + qr.getServiceType().name()) @@ -2584,12 +2584,13 @@ public class P25DecoderState extends DecoderState } break; case STATUS_UPDATE: - StatusUpdate su = (StatusUpdate)message; + io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.StatusUpdate su = + (io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.StatusUpdate)message; if(mLastResponseEventID == null || !su.getTargetAddress() .contentEquals(mLastResponseEventID)) { - broadcast(new P25CallEvent.Builder(CallEventType.RESPONSE) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.RESPONSE) .aliasList(getAliasList()) .details("STATUS USER: " + su.getUserStatus() + " UNIT: " + su.getUnitStatus()) @@ -2613,7 +2614,7 @@ public class P25DecoderState extends DecoderState if(mLastRegistrationEventID == null || !mLastRegistrationEventID.contentEquals(urr.getSourceAddress())) { - broadcast(new P25CallEvent.Builder(CallEventType.REGISTER) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.REGISTER) .aliasList(getAliasList()) .details("REGISTRATION:" + urr.getResponse().name() + " SYSTEM: " + urr.getSystemID() + @@ -2632,7 +2633,7 @@ public class P25DecoderState extends DecoderState !mLastRegistrationEventID.contentEquals(udr.getSourceID())) { - broadcast(new P25CallEvent.Builder(CallEventType.DEREGISTER) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.DEREGISTER) .aliasList(getAliasList()) .from(udr.getSourceID()) .build()); @@ -2679,7 +2680,7 @@ public class P25DecoderState extends DecoderState case GROUP_DATA_CHANNEL_ANNOUNCEMENT: GroupDataChannelAnnouncement gdca = (GroupDataChannelAnnouncement)message; - broadcast(new P25CallEvent.Builder(CallEventType.ANNOUNCEMENT) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.ANNOUNCEMENT) .aliasList(getAliasList()) .channel(gdca.getChannel1()) .details((gdca.isEncrypted() ? "ENCRYPTED" : "") + @@ -2690,7 +2691,7 @@ public class P25DecoderState extends DecoderState if(gdca.hasChannelNumber2()) { - broadcast(new P25CallEvent.Builder(CallEventType.ANNOUNCEMENT) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.ANNOUNCEMENT) .aliasList(getAliasList()) .channel(gdca.getChannel2()) .details((gdca.isEncrypted() ? "ENCRYPTED" : "") + @@ -2704,7 +2705,7 @@ public class P25DecoderState extends DecoderState GroupDataChannelAnnouncementExplicit gdcae = (GroupDataChannelAnnouncementExplicit)message; - broadcast(new P25CallEvent.Builder(CallEventType.DATA_CALL) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.DATA_CALL) .aliasList(getAliasList()) .channel(gdcae.getTransmitChannel()) .details((gdcae.isEncrypted() ? "ENCRYPTED" : "") + @@ -2752,7 +2753,7 @@ public class P25DecoderState extends DecoderState details.append(pgvcg.isEncryptedChannel() ? " ENCRYPTED" : ""); details.append(" ").append(pgvcg.getSessionMode().name()); - P25CallEvent event = new P25CallEvent.Builder(CallEventType.PATCH_GROUP_CALL) + P25CallEvent event = new P25CallEvent.Builder(CallEvent.CallEventType.PATCH_GROUP_CALL) .aliasList(getAliasList()) .channel(channel) .details(details.toString()) @@ -2785,7 +2786,7 @@ public class P25DecoderState extends DecoderState } else { - P25CallEvent event = new P25CallEvent.Builder(CallEventType.PATCH_GROUP_CALL) + P25CallEvent event = new P25CallEvent.Builder(CallEvent.CallEventType.PATCH_GROUP_CALL) .aliasList(getAliasList()) .channel(channel) .details((gvcgu.isTDMAChannel1() ? "TDMA " : "") + @@ -2812,7 +2813,7 @@ public class P25DecoderState extends DecoderState } else { - P25CallEvent event = new P25CallEvent.Builder(CallEventType.PATCH_GROUP_CALL) + P25CallEvent event = new P25CallEvent.Builder(CallEvent.CallEventType.PATCH_GROUP_CALL) .aliasList(getAliasList()) .channel(channel2) .details((gvcgu.isTDMAChannel2() ? "TDMA " : "") + @@ -2842,7 +2843,7 @@ public class P25DecoderState extends DecoderState case CCH_PLANNED_SHUTDOWN: if(!mControlChannelShutdownLogged) { - broadcast(new P25CallEvent.Builder(CallEventType.NOTIFICATION) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.NOTIFICATION) .details("PLANNED CONTROL CHANNEL SHUTDOWN") .build()); @@ -2886,7 +2887,7 @@ public class P25DecoderState extends DecoderState details.append(gdcg.isEncryptedChannel() ? "ENCRYPTED " : ""); details.append(gdcg.getSessionMode().name()); - P25CallEvent event = new P25CallEvent.Builder(CallEventType.DATA_CALL) + P25CallEvent event = new P25CallEvent.Builder(CallEvent.CallEventType.DATA_CALL) .aliasList(getAliasList()) .channel(channel) .details(details.toString()) @@ -2925,7 +2926,7 @@ public class P25DecoderState extends DecoderState details.append(gvcg.isEncryptedChannel() ? "ENCRYPTED " : ""); details.append(gvcg.getSessionMode().name()); - P25CallEvent event = new P25CallEvent.Builder(CallEventType.GROUP_CALL) + P25CallEvent event = new P25CallEvent.Builder(CallEvent.CallEventType.GROUP_CALL) .aliasList(getAliasList()) .channel(channel) .details(details.toString()) @@ -2963,7 +2964,7 @@ public class P25DecoderState extends DecoderState details.append(gvcgu.isEncryptedChannel() ? "ENCRYPTED " : ""); details.append(gvcgu.getSessionMode().name()); - P25CallEvent event = new P25CallEvent.Builder(CallEventType.GROUP_CALL) + P25CallEvent event = new P25CallEvent.Builder(CallEvent.CallEventType.GROUP_CALL) .aliasList(getAliasList()) .channel(gvcgu.getChannel1()) .details(details.toString()) @@ -2999,7 +3000,7 @@ public class P25DecoderState extends DecoderState details.append(gvcgu.isEncryptedChannel() ? "ENCRYPTED " : ""); details.append(gvcgu.getSessionMode().name()); - P25CallEvent event2 = new P25CallEvent.Builder(CallEventType.GROUP_CALL) + P25CallEvent event2 = new P25CallEvent.Builder(CallEvent.CallEventType.GROUP_CALL) .aliasList(getAliasList()) .channel(gvcgu.getChannel2()) .details(details.toString()) @@ -3039,7 +3040,7 @@ public class P25DecoderState extends DecoderState details.append(gvcgue.isEncryptedChannel() ? "ENCRYPTED " : ""); details.append(gvcgue.getSessionMode().name()); - P25CallEvent event = new P25CallEvent.Builder(CallEventType.GROUP_CALL) + P25CallEvent event = new P25CallEvent.Builder(CallEvent.CallEventType.GROUP_CALL) .aliasList(getAliasList()) .channel(channel) .details(details.toString()) @@ -3077,7 +3078,7 @@ public class P25DecoderState extends DecoderState details.append(idcg.isEncryptedChannel() ? "ENCRYPTED " : ""); details.append(idcg.getSessionMode().name()); - P25CallEvent event = new P25CallEvent.Builder(CallEventType.DATA_CALL) + P25CallEvent event = new P25CallEvent.Builder(CallEvent.CallEventType.DATA_CALL) .aliasList(getAliasList()) .channel(channel) .details(details.toString()) @@ -3114,7 +3115,7 @@ public class P25DecoderState extends DecoderState details.append(sdcg.isEncryptedChannel() ? "ENCRYPTED " : ""); details.append(sdcg.getSessionMode().name()); - P25CallEvent event = new P25CallEvent.Builder(CallEventType.DATA_CALL) + P25CallEvent event = new P25CallEvent.Builder(CallEvent.CallEventType.DATA_CALL) .aliasList(getAliasList()) .channel(channel) .details(details.toString()) @@ -3156,7 +3157,7 @@ public class P25DecoderState extends DecoderState details.append("CALL TIMER:").append(tivcg.getCallTimer()); P25CallEvent event = new P25CallEvent.Builder( - CallEventType.TELEPHONE_INTERCONNECT) + CallEvent.CallEventType.TELEPHONE_INTERCONNECT) .aliasList(getAliasList()) .channel(channel) .details(details.toString()) @@ -3199,7 +3200,7 @@ public class P25DecoderState extends DecoderState details.append("CALL TIMER:").append(tivcgu.getCallTimer()); P25CallEvent event = new P25CallEvent.Builder( - CallEventType.TELEPHONE_INTERCONNECT) + CallEvent.CallEventType.TELEPHONE_INTERCONNECT) .aliasList(getAliasList()) .channel(channel) .details(details.toString()) @@ -3238,7 +3239,7 @@ public class P25DecoderState extends DecoderState details.append(uuvcg.getSessionMode().name()); P25CallEvent event = new P25CallEvent.Builder( - CallEventType.UNIT_TO_UNIT_CALL) + CallEvent.CallEventType.UNIT_TO_UNIT_CALL) .aliasList(getAliasList()) .channel(channel) .details(details.toString()) @@ -3277,7 +3278,7 @@ public class P25DecoderState extends DecoderState details.append(uuvcgu.getSessionMode().name()); P25CallEvent event = new P25CallEvent.Builder( - CallEventType.UNIT_TO_UNIT_CALL) + CallEvent.CallEventType.UNIT_TO_UNIT_CALL) .aliasList(getAliasList()) .channel(channel) .details(details.toString()) @@ -3335,21 +3336,21 @@ public class P25DecoderState extends DecoderState switch(message.getOpcode()) { case CALL_ALERT: - CallAlert ca = (CallAlert)message; + io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.CallAlert ca = (io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.CallAlert)message; - broadcast(new P25CallEvent.Builder(CallEventType.PAGE) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.PAGE) .aliasList(getAliasList()) .from(ca.getSourceID()) .to(ca.getTargetAddress()) .build()); break; case UNIT_TO_UNIT_ANSWER_REQUEST: - UnitToUnitAnswerRequest utuar = (UnitToUnitAnswerRequest)message; + io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.UnitToUnitAnswerRequest utuar = (io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.UnitToUnitAnswerRequest)message; if(mLastPageEventID == null || !mLastPageEventID .contentEquals(utuar.getTargetAddress())) { - broadcast(new P25CallEvent.Builder(CallEventType.PAGE) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.PAGE) .aliasList(getAliasList()) .details((utuar.isEmergency() ? "EMERGENCY" : "")) .from(utuar.getSourceAddress()) @@ -3365,7 +3366,7 @@ public class P25DecoderState extends DecoderState if(mLastPageEventID == null || !mLastPageEventID .contentEquals(sdpr.getTargetAddress())) { - broadcast(new P25CallEvent.Builder(CallEventType.PAGE) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.PAGE) .aliasList(getAliasList()) .details("SNDCP DATA DAC: " + sdpr.getDataAccessControl() + @@ -3377,13 +3378,13 @@ public class P25DecoderState extends DecoderState } break; case TELEPHONE_INTERCONNECT_ANSWER_REQUEST: - TelephoneInterconnectAnswerRequest tiar = - (TelephoneInterconnectAnswerRequest)message; + io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.TelephoneInterconnectAnswerRequest tiar = + (io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.TelephoneInterconnectAnswerRequest)message; if(mLastPageEventID == null || !mLastPageEventID .contentEquals(tiar.getTargetAddress())) { - broadcast(new P25CallEvent.Builder(CallEventType.PAGE) + broadcast(new P25CallEvent.Builder(CallEvent.CallEventType.PAGE) .aliasList(getAliasList()) .details(("TELEPHONE INTERCONNECT")) .from(tiar.getTelephoneNumber()) @@ -3481,7 +3482,7 @@ public class P25DecoderState extends DecoderState } else { - for(module.decode.p25.message.tsbk.osp.control.SecondaryControlChannelBroadcast sec : mSecondaryControlChannels) + for(SecondaryControlChannelBroadcast sec : mSecondaryControlChannels) { sb.append("SCCH DOWNLINK ") .append(mFrequencyFormatter.format((double)sec.getDownlinkFrequency1() / 1E6d)) diff --git a/src/module/decode/p25/P25Interleave.java b/src/main/java/io/github/dsheirer/module/decode/p25/P25Interleave.java similarity index 98% rename from src/module/decode/p25/P25Interleave.java rename to src/main/java/io/github/dsheirer/module/decode/p25/P25Interleave.java index c590e616..de6f3231 100644 --- a/src/module/decode/p25/P25Interleave.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/P25Interleave.java @@ -1,11 +1,10 @@ -package module.decode.p25; - -import java.util.BitSet; +package io.github.dsheirer.module.decode.p25; +import io.github.dsheirer.bits.BinaryMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import bits.BinaryMessage; +import java.util.BitSet; /** * Utility class to process interleave of P25 Voice and Data messages. @@ -85,7 +84,7 @@ public class P25Interleave /* Clear block bits in source message */ message.clear( start, end ); - /* Iterate only the set bits in the original message and apply + /* Iterate only the set bits in the original message and apply * the deinterleave -- we don't have to evaluate the 0 bits */ for (int i = original.nextSetBit( 0 ); i >= 0 && i < pattern.length; @@ -126,7 +125,7 @@ public class P25Interleave /* Clear block bits in source message */ message.clear( start, end ); - /* Iterate only the set bits in the original message and apply + /* Iterate only the set bits in the original message and apply * the deinterleave -- we don't have to evaluate the 0 bits */ for (int i = original.nextSetBit( 0 ); i >= 0 && i < pattern.length; diff --git a/src/module/decode/p25/P25MessageFramer.java b/src/main/java/io/github/dsheirer/module/decode/p25/P25MessageFramer.java similarity index 89% rename from src/module/decode/p25/P25MessageFramer.java rename to src/main/java/io/github/dsheirer/module/decode/p25/P25MessageFramer.java index 30af300b..8a0d4397 100644 --- a/src/module/decode/p25/P25MessageFramer.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/P25MessageFramer.java @@ -1,43 +1,41 @@ -package module.decode.p25; - -import java.util.ArrayList; - -import message.Message; -import module.decode.p25.message.P25Message; -import module.decode.p25.message.hdu.HDUMessage; -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.message.ldu.LDU2Message; -import module.decode.p25.message.ldu.lc.LDULCMessageFactory; -import module.decode.p25.message.pdu.PDUMessage; -import module.decode.p25.message.pdu.PDUMessageFactory; -import module.decode.p25.message.pdu.confirmed.PDUConfirmedMessage; -import module.decode.p25.message.pdu.confirmed.PDUConfirmedMessageFactory; -import module.decode.p25.message.tdu.TDUMessage; -import module.decode.p25.message.tdu.lc.TDULCMessageFactory; -import module.decode.p25.message.tdu.lc.TDULinkControlMessage; -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.message.tsbk.TSBKMessageFactory; -import module.decode.p25.message.vselp.VSELP1Message; -import module.decode.p25.message.vselp.VSELP2Message; -import module.decode.p25.reference.DataUnitID; +package io.github.dsheirer.module.decode.p25; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.bits.BitSetFullException; +import io.github.dsheirer.bits.ISyncDetectListener; +import io.github.dsheirer.bits.MultiSyncPatternMatcher; +import io.github.dsheirer.bits.SoftSyncDetector; +import io.github.dsheirer.bits.SyncDetector; +import io.github.dsheirer.dsp.psk.LSMDemodulator; +import io.github.dsheirer.dsp.symbol.Dibit; +import io.github.dsheirer.dsp.symbol.FrameSync; +import io.github.dsheirer.edac.BCH_63_16_11; +import io.github.dsheirer.edac.CRC; +import io.github.dsheirer.edac.CRCP25; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.module.decode.p25.message.P25Message; +import io.github.dsheirer.module.decode.p25.message.hdu.HDUMessage; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU2Message; +import io.github.dsheirer.module.decode.p25.message.ldu.lc.LDULCMessageFactory; +import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; +import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessageFactory; +import io.github.dsheirer.module.decode.p25.message.pdu.confirmed.PDUConfirmedMessage; +import io.github.dsheirer.module.decode.p25.message.pdu.confirmed.PDUConfirmedMessageFactory; +import io.github.dsheirer.module.decode.p25.message.tdu.TDUMessage; +import io.github.dsheirer.module.decode.p25.message.tdu.lc.TDULCMessageFactory; +import io.github.dsheirer.module.decode.p25.message.tdu.lc.TDULinkControlMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessageFactory; +import io.github.dsheirer.module.decode.p25.message.vselp.VSELP1Message; +import io.github.dsheirer.module.decode.p25.message.vselp.VSELP2Message; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.sample.Listener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; -import alias.AliasList; -import bits.BinaryMessage; -import bits.BitSetFullException; -import bits.ISyncDetectListener; -import bits.MultiSyncPatternMatcher; -import bits.SoftSyncDetector; -import bits.SyncDetector; -import dsp.psk.LSMDemodulator; -import dsp.symbol.Dibit; -import dsp.symbol.FrameSync; -import edac.BCH_63_16_11; -import edac.CRC; -import edac.CRCP25; +import java.util.ArrayList; public class P25MessageFramer implements Listener { @@ -115,7 +113,7 @@ public class P25MessageFramer implements Listener /** * We use two message assemblers to catch any sync detections, so that * if we have a false trigger then we still have a chance to catch the - * valid message. If we have two false triggers before the arrival of + * valid message. If we have two false triggers before the arrival of * the actual message sync, then the third or subsequent real or false * sync pattern will produce a debug message indicating no assemblers * are available.. @@ -132,7 +130,7 @@ public class P25MessageFramer implements Listener { /* For CQPSK, we include 3 additional sync detectors to watch for and * correct +/-90 and 180 degree costas loop phase lock errors */ - mMatcher.add( new CostasPhaseErrorDetector( FrameSync.P25_PHASE1_ERROR_90_CCW, + mMatcher.add( new CostasPhaseErrorDetector( FrameSync.P25_PHASE1_ERROR_90_CCW, demodulator, PHASE_CORRECTION_90_DEGREES ) ); mMatcher.add( new CostasPhaseErrorDetector( FrameSync.P25_PHASE1_ERROR_90_CW, @@ -309,7 +307,7 @@ public class P25MessageFramer implements Listener case LDU1: mComplete = true; - LDU1Message ldu1 = new LDU1Message( mMessage.copy(), + LDU1Message ldu1 = new LDU1Message( mMessage.copy(), mDUID, mAliasList ); /* Convert the LDU1 message into a link control LDU1 message */ @@ -380,7 +378,7 @@ public class P25MessageFramer implements Listener { mMessage.setSize( PDU2_BEGIN ); - PDUMessage pduMessage1 = PDUMessageFactory.getMessage( + PDUMessage pduMessage1 = PDUMessageFactory.getMessage( mMessage.copy(), DataUnitID.PDU1, mAliasList ); dispatch( pduMessage1 ); @@ -443,8 +441,7 @@ public class P25MessageFramer implements Listener { mMessage.setSize( PDU3_DECODED_END ); - PDUMessage pduMessage3 = PDUMessageFactory.getMessage( - mMessage.copy(), DataUnitID.PDU3, mAliasList ); + PDUMessage pduMessage3 = PDUMessageFactory.getMessage(mMessage.copy(), DataUnitID.PDU3, mAliasList ); dispatch( pduMessage3 ); } @@ -476,7 +473,7 @@ public class P25MessageFramer implements Listener } else { - PDUConfirmedMessage pducm = + PDUConfirmedMessage pducm = new PDUConfirmedMessage( mMessage.copy(), mAliasList ); @@ -510,7 +507,7 @@ public class P25MessageFramer implements Listener mPrimarySyncDetector.setThreshold( SYNC_MATCH_THRESHOLD ); break; case TDULC: - TDULinkControlMessage tdulc = new TDULinkControlMessage( + TDULinkControlMessage tdulc = new TDULinkControlMessage( mMessage.copy(), mDUID, mAliasList ); /* Convert to an appropriate link control message */ @@ -539,7 +536,7 @@ public class P25MessageFramer implements Listener BinaryMessage tsbkBuffer1 = mMessage.copy(); tsbkBuffer1.setSize( TSBK_DECODED_END ); - TSBKMessage tsbkMessage1 = TSBKMessageFactory.getMessage( + TSBKMessage tsbkMessage1 = TSBKMessageFactory.getMessage( tsbkBuffer1, DataUnitID.TSBK1, mAliasList ); if( tsbkMessage1.isLastBlock() ) diff --git a/src/module/decode/p25/P25MessageProcessor.java b/src/main/java/io/github/dsheirer/module/decode/p25/P25MessageProcessor.java similarity index 83% rename from src/module/decode/p25/P25MessageProcessor.java rename to src/main/java/io/github/dsheirer/module/decode/p25/P25MessageProcessor.java index d34437bd..51d3978d 100644 --- a/src/module/decode/p25/P25MessageProcessor.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/P25MessageProcessor.java @@ -1,17 +1,15 @@ -package module.decode.p25; - -import java.util.HashMap; - -import message.Message; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.ldu.LDUMessage; +package io.github.dsheirer.module.decode.p25; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.ldu.LDUMessage; +import io.github.dsheirer.sample.Listener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import alias.AliasList; -import sample.Listener; +import java.util.HashMap; public class P25MessageProcessor implements Listener { @@ -23,7 +21,7 @@ public class P25MessageProcessor implements Listener /* Map of up to 16 band identifiers per RFSS. These identifier update * messages are inserted into any message that conveys channel information * so that the uplink/downlink frequencies can be calculated */ - private HashMap mBandIdentifierMap = + private HashMap mBandIdentifierMap = new HashMap(); private AliasList mAliasList; @@ -73,7 +71,7 @@ public class P25MessageProcessor implements Listener * Broadcast all valid messages and any LDU voice messages regardless if * they are valid or not, so that we don't miss any voice frames */ - if( mMessageListener != null && message.isValid() || message instanceof LDUMessage ) + if( mMessageListener != null && message.isValid() || message instanceof LDUMessage) { mMessageListener.receive( message ); } diff --git a/src/module/decode/p25/P25_C4FMDecoder.java b/src/main/java/io/github/dsheirer/module/decode/p25/P25_C4FMDecoder.java similarity index 88% rename from src/module/decode/p25/P25_C4FMDecoder.java rename to src/main/java/io/github/dsheirer/module/decode/p25/P25_C4FMDecoder.java index 2e7b1114..13512400 100644 --- a/src/module/decode/p25/P25_C4FMDecoder.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/P25_C4FMDecoder.java @@ -16,32 +16,24 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25; +package io.github.dsheirer.module.decode.p25; -import instrument.tap.Tap; -import instrument.tap.TapGroup; -import instrument.tap.stream.DibitTap; -import instrument.tap.stream.FloatBufferTap; -import instrument.tap.stream.FloatTap; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.instrument.tap.Tap; +import io.github.dsheirer.instrument.tap.TapGroup; +import io.github.dsheirer.instrument.tap.stream.DibitTap; +import io.github.dsheirer.instrument.tap.stream.FloatTap; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.IFilteredRealBufferListener; +import io.github.dsheirer.sample.real.RealBuffer; +import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ScheduledExecutorService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import alias.AliasList; -import sample.Listener; -import sample.real.IFilteredRealBufferListener; -import sample.real.RealBuffer; -import source.tuner.frequency.FrequencyChangeEvent; -import source.tuner.frequency.IFrequencyChangeListener; -import source.tuner.frequency.IFrequencyChangeProvider; -import dsp.filter.FilterFactory; -import dsp.filter.Window.WindowType; -import dsp.filter.fir.real.RealFIRFilter_RB_RB; - public class P25_C4FMDecoder extends P25Decoder implements IFilteredRealBufferListener { private final static Logger mLog = LoggerFactory.getLogger( P25_C4FMDecoder.class ); @@ -57,18 +49,18 @@ public class P25_C4FMDecoder extends P25Decoder implements IFilteredRealBufferLi /** * P25 Phase 1 C4FM Decoder processes real buffers of un-filtered, - * demodulated audio and produces decoded P25 Phase 1 Messages. + * demodulated audio and produces decoded P25 Phase 1 Messages. * * Provides Frequency Control to steer external tuner source and incorporates * internal gain control. * * Note: use the P25AudioModule to convert the decoded messages into audio. * - * @param aliasList - optional (can be null) list of alias values for network + * @param aliasList - optional (can be null) list of alias values for network * infrastructure and subscriber identities that will be included in each * decoded message */ - public P25_C4FMDecoder( AliasList aliasList, int frequencyCorrectionMaximum ) + public P25_C4FMDecoder(AliasList aliasList, int frequencyCorrectionMaximum ) { super( aliasList ); diff --git a/src/module/decode/p25/P25_LSMDecoder.java b/src/main/java/io/github/dsheirer/module/decode/p25/P25_LSMDecoder.java similarity index 85% rename from src/module/decode/p25/P25_LSMDecoder.java rename to src/main/java/io/github/dsheirer/module/decode/p25/P25_LSMDecoder.java index db41a441..806b20e6 100644 --- a/src/module/decode/p25/P25_LSMDecoder.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/P25_LSMDecoder.java @@ -15,35 +15,33 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.p25; +package io.github.dsheirer.module.decode.p25; -import instrument.tap.Tap; -import instrument.tap.TapGroup; -import instrument.tap.stream.ComplexSampleTap; -import instrument.tap.stream.ComplexTap; -import instrument.tap.stream.DibitTap; -import instrument.tap.stream.QPSKTap; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.dsp.filter.FilterFactory; +import io.github.dsheirer.dsp.filter.Window.WindowType; +import io.github.dsheirer.dsp.filter.fir.complex.ComplexFIRFilter_CB_CB; +import io.github.dsheirer.dsp.gain.ComplexFeedForwardGainControl; +import io.github.dsheirer.dsp.psk.LSMDemodulator; +import io.github.dsheirer.dsp.psk.QPSKPolarSlicer; +import io.github.dsheirer.instrument.tap.Tap; +import io.github.dsheirer.instrument.tap.TapGroup; +import io.github.dsheirer.instrument.tap.stream.ComplexSampleTap; +import io.github.dsheirer.instrument.tap.stream.ComplexTap; +import io.github.dsheirer.instrument.tap.stream.DibitTap; +import io.github.dsheirer.instrument.tap.stream.QPSKTap; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.ComplexBuffer; +import io.github.dsheirer.sample.complex.ComplexBufferToStreamConverter; +import io.github.dsheirer.sample.complex.IComplexBufferListener; +import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ScheduledExecutorService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import alias.AliasList; -import sample.Listener; -import sample.complex.ComplexBuffer; -import sample.complex.ComplexBufferToStreamConverter; -import sample.complex.IComplexBufferListener; -import dsp.filter.FilterFactory; -import dsp.filter.Window.WindowType; -import dsp.filter.fir.complex.ComplexFIRFilter_CB_CB; -import dsp.gain.ComplexFeedForwardGainControl; -import dsp.psk.LSMDemodulator; -import dsp.psk.QPSKPolarSlicer; -import source.tuner.frequency.FrequencyChangeEvent; - public class P25_LSMDecoder extends P25Decoder implements IComplexBufferListener { private final static Logger mLog = LoggerFactory.getLogger( P25_LSMDecoder.class ); diff --git a/src/module/decode/p25/PatchGroup.java b/src/main/java/io/github/dsheirer/module/decode/p25/PatchGroup.java similarity index 98% rename from src/module/decode/p25/PatchGroup.java rename to src/main/java/io/github/dsheirer/module/decode/p25/PatchGroup.java index 525602ad..97a1e923 100644 --- a/src/module/decode/p25/PatchGroup.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/PatchGroup.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25; +package io.github.dsheirer.module.decode.p25; import java.util.ArrayList; import java.util.List; diff --git a/src/module/decode/p25/PatchGroupManager.java b/src/main/java/io/github/dsheirer/module/decode/p25/PatchGroupManager.java similarity index 95% rename from src/module/decode/p25/PatchGroupManager.java rename to src/main/java/io/github/dsheirer/module/decode/p25/PatchGroupManager.java index 8642923e..1208ab22 100644 --- a/src/module/decode/p25/PatchGroupManager.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/PatchGroupManager.java @@ -16,14 +16,14 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25; +package io.github.dsheirer.module.decode.p25; -import alias.Alias; -import alias.AliasList; -import alias.PatchGroupAlias; -import alias.id.talkgroup.TalkgroupID; -import module.decode.event.CallEvent; -import sample.Broadcaster; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.alias.PatchGroupAlias; +import io.github.dsheirer.alias.id.talkgroup.TalkgroupID; +import io.github.dsheirer.module.decode.event.CallEvent; +import io.github.dsheirer.sample.Broadcaster; import java.util.ArrayList; import java.util.Iterator; diff --git a/src/module/decode/p25/Trellis_1_2_Rate.java b/src/main/java/io/github/dsheirer/module/decode/p25/Trellis_1_2_Rate.java similarity index 98% rename from src/module/decode/p25/Trellis_1_2_Rate.java rename to src/main/java/io/github/dsheirer/module/decode/p25/Trellis_1_2_Rate.java index 7a6c096d..25c8b19a 100644 --- a/src/module/decode/p25/Trellis_1_2_Rate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/Trellis_1_2_Rate.java @@ -1,13 +1,12 @@ -package module.decode.p25; - -import java.util.ArrayList; -import java.util.Random; +package io.github.dsheirer.module.decode.p25; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.dsp.symbol.Dibit; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import bits.BinaryMessage; -import dsp.symbol.Dibit; +import java.util.ArrayList; +import java.util.Random; public class Trellis_1_2_Rate { diff --git a/src/module/decode/p25/Trellis_3_4_Rate.java b/src/main/java/io/github/dsheirer/module/decode/p25/Trellis_3_4_Rate.java similarity index 99% rename from src/module/decode/p25/Trellis_3_4_Rate.java rename to src/main/java/io/github/dsheirer/module/decode/p25/Trellis_3_4_Rate.java index 4cca9cf7..cea87249 100644 --- a/src/module/decode/p25/Trellis_3_4_Rate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/Trellis_3_4_Rate.java @@ -1,16 +1,15 @@ -package module.decode.p25; +package io.github.dsheirer.module.decode.p25; + +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.dsp.symbol.Dibit; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import bits.BinaryMessage; -import dsp.symbol.Dibit; - public class Trellis_3_4_Rate { private final static Logger mLog = @@ -60,7 +59,7 @@ public class Trellis_3_4_Rate } /** - * Creates a lookup map for state to input tribit values for a given + * Creates a lookup map for state to input tribit values for a given * constellation. Input tribits are contained in the array using the state * tribit's value as the lookup index. Null values indicate illegal state * and input combinations for the specified constellation. @@ -97,7 +96,7 @@ public class Trellis_3_4_Rate /** * Decodes a 196-bit 3/4 rate convolutional encoded message located between - * start and end indexes and returns the decoded 144-bit message overlayed + * start and end indexes and returns the decoded 144-bit message overlayed * upon the original message with the remaining 52 bits cleared to zero. * * @return - original message with decoded message bits.. @@ -197,7 +196,7 @@ public class Trellis_3_4_Rate } /** - * Path metrics maintains a map of the current best path metrics that end + * Path metrics maintains a map of the current best path metrics that end * at each of the 8 valid tribit values. Each new path is evaluated against * the current best path for retention (survivor) or disposal (dead). A * best metric is maintained to evaluate the Walking Dead for disposal. diff --git a/src/module/decode/p25/audio/P25AudioModule.java b/src/main/java/io/github/dsheirer/module/decode/p25/audio/P25AudioModule.java similarity index 90% rename from src/module/decode/p25/audio/P25AudioModule.java rename to src/main/java/io/github/dsheirer/module/decode/p25/audio/P25AudioModule.java index d6aa4c9f..f94f4b9b 100644 --- a/src/module/decode/p25/audio/P25AudioModule.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/audio/P25AudioModule.java @@ -1,24 +1,24 @@ -package module.decode.p25.audio; +package io.github.dsheirer.module.decode.p25.audio; -import audio.AudioFormats; -import audio.AudioPacket; -import audio.IAudioPacketProvider; -import audio.squelch.ISquelchStateListener; -import audio.squelch.SquelchState; -import channel.metadata.Metadata; -import dsp.gain.NonClippingGain; +import io.github.dsheirer.audio.AudioFormats; +import io.github.dsheirer.audio.AudioPacket; +import io.github.dsheirer.audio.IAudioPacketProvider; +import io.github.dsheirer.audio.squelch.ISquelchStateListener; +import io.github.dsheirer.audio.squelch.SquelchState; +import io.github.dsheirer.channel.metadata.Metadata; +import io.github.dsheirer.dsp.gain.NonClippingGain; +import io.github.dsheirer.message.IMessageListener; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.module.Module; +import io.github.dsheirer.module.decode.p25.message.hdu.HDUMessage; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU2Message; +import io.github.dsheirer.module.decode.p25.message.ldu.LDUMessage; +import io.github.dsheirer.sample.Listener; import jmbe.iface.AudioConversionLibrary; import jmbe.iface.AudioConverter; -import message.IMessageListener; -import message.Message; -import module.Module; -import module.decode.p25.message.hdu.HDUMessage; -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.message.ldu.LDU2Message; -import module.decode.p25.message.ldu.LDUMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; import java.util.concurrent.ScheduledExecutorService; diff --git a/src/module/decode/p25/message/IAdjacentSite.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/IAdjacentSite.java similarity index 88% rename from src/module/decode/p25/message/IAdjacentSite.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/IAdjacentSite.java index ea9e4ef6..afd06a5e 100644 --- a/src/module/decode/p25/message/IAdjacentSite.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/IAdjacentSite.java @@ -1,4 +1,4 @@ -package module.decode.p25.message; +package io.github.dsheirer.module.decode.p25.message; /** * Interface for adjacent site (ie neighbor) messages diff --git a/src/module/decode/p25/message/IBandIdentifier.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/IBandIdentifier.java similarity index 96% rename from src/module/decode/p25/message/IBandIdentifier.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/IBandIdentifier.java index 1f3524eb..3471efba 100644 --- a/src/module/decode/p25/message/IBandIdentifier.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/IBandIdentifier.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message; +package io.github.dsheirer.module.decode.p25.message; public interface IBandIdentifier { diff --git a/src/module/decode/p25/message/IdentifierReceiver.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/IdentifierReceiver.java similarity index 87% rename from src/module/decode/p25/message/IdentifierReceiver.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/IdentifierReceiver.java index a1c65c63..af1c6313 100644 --- a/src/module/decode/p25/message/IdentifierReceiver.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/IdentifierReceiver.java @@ -1,4 +1,4 @@ -package module.decode.p25.message; +package io.github.dsheirer.module.decode.p25.message; /** diff --git a/src/module/decode/p25/message/P25Message.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/P25Message.java similarity index 91% rename from src/module/decode/p25/message/P25Message.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/P25Message.java index 730c8acf..594c510b 100644 --- a/src/module/decode/p25/message/P25Message.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/P25Message.java @@ -16,15 +16,15 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message; +package io.github.dsheirer.module.decode.p25.message; -import alias.Alias; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRC; -import map.Plottable; -import message.Message; -import module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRC; +import io.github.dsheirer.map.Plottable; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import java.text.SimpleDateFormat; diff --git a/src/module/decode/p25/message/filter/HDUMessageFilter.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/filter/HDUMessageFilter.java similarity index 66% rename from src/module/decode/p25/message/filter/HDUMessageFilter.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/filter/HDUMessageFilter.java index c43cbda8..0ea7fd80 100644 --- a/src/module/decode/p25/message/filter/HDUMessageFilter.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/filter/HDUMessageFilter.java @@ -1,13 +1,13 @@ -package module.decode.p25.message.filter; +package io.github.dsheirer.module.decode.p25.message.filter; + +import io.github.dsheirer.filter.Filter; +import io.github.dsheirer.filter.FilterElement; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.module.decode.p25.message.hdu.HDUMessage; import java.util.Collections; import java.util.List; -import message.Message; -import module.decode.p25.message.hdu.HDUMessage; -import filter.Filter; -import filter.FilterElement; - public class HDUMessageFilter extends Filter { public HDUMessageFilter() diff --git a/src/module/decode/p25/message/filter/LDUMessageFilter.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/filter/LDUMessageFilter.java similarity index 66% rename from src/module/decode/p25/message/filter/LDUMessageFilter.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/filter/LDUMessageFilter.java index d0fcfb52..b94a1232 100644 --- a/src/module/decode/p25/message/filter/LDUMessageFilter.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/filter/LDUMessageFilter.java @@ -1,13 +1,13 @@ -package module.decode.p25.message.filter; +package io.github.dsheirer.module.decode.p25.message.filter; + +import io.github.dsheirer.filter.Filter; +import io.github.dsheirer.filter.FilterElement; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.module.decode.p25.message.ldu.LDUMessage; import java.util.Collections; import java.util.List; -import message.Message; -import module.decode.p25.message.ldu.LDUMessage; -import filter.Filter; -import filter.FilterElement; - public class LDUMessageFilter extends Filter { public LDUMessageFilter() diff --git a/src/module/decode/p25/message/filter/P25MessageFilterSet.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/filter/P25MessageFilterSet.java similarity index 69% rename from src/module/decode/p25/message/filter/P25MessageFilterSet.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/filter/P25MessageFilterSet.java index f4f72258..83c50038 100644 --- a/src/module/decode/p25/message/filter/P25MessageFilterSet.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/filter/P25MessageFilterSet.java @@ -1,8 +1,8 @@ -package module.decode.p25.message.filter; +package io.github.dsheirer.module.decode.p25.message.filter; -import message.Message; -import module.decode.p25.message.P25Message; -import filter.FilterSet; +import io.github.dsheirer.filter.FilterSet; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.module.decode.p25.message.P25Message; public class P25MessageFilterSet extends FilterSet { diff --git a/src/module/decode/p25/message/filter/PDUMessageFilter.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/filter/PDUMessageFilter.java similarity index 72% rename from src/module/decode/p25/message/filter/PDUMessageFilter.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/filter/PDUMessageFilter.java index a18bd47d..e5a6ad76 100644 --- a/src/module/decode/p25/message/filter/PDUMessageFilter.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/filter/PDUMessageFilter.java @@ -1,15 +1,15 @@ -package module.decode.p25.message.filter; +package io.github.dsheirer.module.decode.p25.message.filter; + +import io.github.dsheirer.filter.Filter; +import io.github.dsheirer.filter.FilterElement; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; +import io.github.dsheirer.module.decode.p25.reference.Opcode; import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import message.Message; -import module.decode.p25.message.pdu.PDUMessage; -import module.decode.p25.reference.Opcode; -import filter.Filter; -import filter.FilterElement; - public class PDUMessageFilter extends Filter { private HashMap> mOpcodeFilterElements = @@ -28,7 +28,7 @@ public class PDUMessageFilter extends Filter @Override public boolean passes( Message message ) { - if( mEnabled && message instanceof PDUMessage ) + if( mEnabled && message instanceof PDUMessage) { PDUMessage pdu = (PDUMessage)message; diff --git a/src/module/decode/p25/message/filter/TDULCMessageFilter.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/filter/TDULCMessageFilter.java similarity index 67% rename from src/module/decode/p25/message/filter/TDULCMessageFilter.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/filter/TDULCMessageFilter.java index 6bcb7d1a..b123fabf 100644 --- a/src/module/decode/p25/message/filter/TDULCMessageFilter.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/filter/TDULCMessageFilter.java @@ -1,13 +1,13 @@ -package module.decode.p25.message.filter; +package io.github.dsheirer.module.decode.p25.message.filter; + +import io.github.dsheirer.filter.Filter; +import io.github.dsheirer.filter.FilterElement; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.module.decode.p25.message.tdu.lc.TDULinkControlMessage; import java.util.Collections; import java.util.List; -import message.Message; -import module.decode.p25.message.tdu.lc.TDULinkControlMessage; -import filter.Filter; -import filter.FilterElement; - public class TDULCMessageFilter extends Filter { public TDULCMessageFilter() diff --git a/src/module/decode/p25/message/filter/TDUMessageFilter.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/filter/TDUMessageFilter.java similarity index 66% rename from src/module/decode/p25/message/filter/TDUMessageFilter.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/filter/TDUMessageFilter.java index f87dc835..ef50e572 100644 --- a/src/module/decode/p25/message/filter/TDUMessageFilter.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/filter/TDUMessageFilter.java @@ -1,13 +1,13 @@ -package module.decode.p25.message.filter; +package io.github.dsheirer.module.decode.p25.message.filter; + +import io.github.dsheirer.filter.Filter; +import io.github.dsheirer.filter.FilterElement; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.module.decode.p25.message.tdu.TDUMessage; import java.util.Collections; import java.util.List; -import message.Message; -import module.decode.p25.message.tdu.TDUMessage; -import filter.Filter; -import filter.FilterElement; - public class TDUMessageFilter extends Filter { public TDUMessageFilter() diff --git a/src/module/decode/p25/message/filter/TSBKMessageFilterSet.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/filter/TSBKMessageFilterSet.java similarity index 86% rename from src/module/decode/p25/message/filter/TSBKMessageFilterSet.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/filter/TSBKMessageFilterSet.java index 337c0fb0..34e3f0e4 100644 --- a/src/module/decode/p25/message/filter/TSBKMessageFilterSet.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/filter/TSBKMessageFilterSet.java @@ -1,19 +1,19 @@ -package module.decode.p25.message.filter; +package io.github.dsheirer.module.decode.p25.message.filter; + +import io.github.dsheirer.filter.Filter; +import io.github.dsheirer.filter.FilterElement; +import io.github.dsheirer.filter.FilterSet; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.MotorolaOpcode; +import io.github.dsheirer.module.decode.p25.message.tsbk.vendor.VendorOpcode; +import io.github.dsheirer.module.decode.p25.reference.Opcode; +import io.github.dsheirer.module.decode.p25.reference.Vendor; import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import message.Message; -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.message.tsbk.motorola.MotorolaOpcode; -import module.decode.p25.message.tsbk.vendor.VendorOpcode; -import module.decode.p25.reference.Opcode; -import module.decode.p25.reference.Vendor; -import filter.Filter; -import filter.FilterElement; -import filter.FilterSet; - public class TSBKMessageFilterSet extends FilterSet { public TSBKMessageFilterSet() @@ -30,7 +30,7 @@ public class TSBKMessageFilterSet extends FilterSet // { // if( mEnabled && canProcess( message ) ) // { -// TSBKMessage tsbk = (TSBKMessage)message; +// TSBKMessage tsbk = (TSBKMessage) message; // // switch( tsbk.getVendor() ) // { @@ -53,7 +53,7 @@ public class TSBKMessageFilterSet extends FilterSet public class StandardOpcodeFilter extends Filter { - private HashMap> mStandardElements = + private HashMap> mStandardElements = new HashMap>(); public StandardOpcodeFilter() @@ -102,7 +102,7 @@ public class TSBKMessageFilterSet extends FilterSet public class MotorolaOpcodeFilter extends Filter { - private HashMap> mMotorolaElements = + private HashMap> mMotorolaElements = new HashMap>(); public MotorolaOpcodeFilter() diff --git a/src/module/decode/p25/message/hdu/HDUMessage.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/hdu/HDUMessage.java similarity index 95% rename from src/module/decode/p25/message/hdu/HDUMessage.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/hdu/HDUMessage.java index eb3ab336..a72894f9 100644 --- a/src/module/decode/p25/message/hdu/HDUMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/hdu/HDUMessage.java @@ -1,18 +1,16 @@ -package module.decode.p25.message.hdu; - -import module.decode.p25.message.P25Message; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Encryption; +package io.github.dsheirer.module.decode.p25.message.hdu; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRC; +import io.github.dsheirer.edac.Golay18; +import io.github.dsheirer.edac.ReedSolomon_63_47_17; +import io.github.dsheirer.module.decode.p25.message.P25Message; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Encryption; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRC; -import edac.Golay18; -import edac.ReedSolomon_63_47_17; - public class HDUMessage extends P25Message { private final static Logger mLog = LoggerFactory.getLogger( HDUMessage.class ); @@ -100,7 +98,7 @@ public class HDUMessage extends P25Message mCRC[ 1 ] = CRC.PASSED; /* Reed-Solomon( 36,20,17 ) error detection and correction - * Check the Reed-Solomon parity bits. The RS decoder expects the link + * Check the Reed-Solomon parity bits. The RS decoder expects the link * control data and reed solomon parity hex codewords in reverse order. * The RS(24,12,13) code used by P25 removes the left-hand 47 data hex * words, so we replace them with zeros. */ diff --git a/src/module/decode/p25/message/ldu/LDU1Message.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/LDU1Message.java similarity index 93% rename from src/module/decode/p25/message/ldu/LDU1Message.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/LDU1Message.java index 03f53741..a39f2706 100644 --- a/src/module/decode/p25/message/ldu/LDU1Message.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/LDU1Message.java @@ -1,14 +1,14 @@ -package module.decode.p25.message.ldu; +package io.github.dsheirer.module.decode.p25.message.ldu; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRC; -import edac.Hamming10; -import edac.ReedSolomon_63_47_17; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.LinkControlOpcode; -import module.decode.p25.reference.Vendor; -import module.decode.p25.reference.VendorLinkControlOpcode; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRC; +import io.github.dsheirer.edac.Hamming10; +import io.github.dsheirer.edac.ReedSolomon_63_47_17; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.reference.Vendor; +import io.github.dsheirer.module.decode.p25.reference.VendorLinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -105,7 +105,7 @@ public class LDU1Message extends LDUMessage } /* Reed-Solomon( 24,16,9 ) error detection and correction - * Check the Reed-Solomon parity bits. The RS decoder expects the code + * Check the Reed-Solomon parity bits. The RS decoder expects the code * words and reed solomon parity hex codewords in reverse order. * * Since this is a truncated RS(63) codes, we pad the code with zeros */ diff --git a/src/module/decode/p25/message/ldu/LDU2Message.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/LDU2Message.java similarity index 94% rename from src/module/decode/p25/message/ldu/LDU2Message.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/LDU2Message.java index 5fffa1dd..ec72fe01 100644 --- a/src/module/decode/p25/message/ldu/LDU2Message.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/LDU2Message.java @@ -1,17 +1,15 @@ -package module.decode.p25.message.ldu; - -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Encryption; +package io.github.dsheirer.module.decode.p25.message.ldu; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRC; +import io.github.dsheirer.edac.Hamming10; +import io.github.dsheirer.edac.ReedSolomon_63_47_17; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Encryption; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRC; -import edac.Hamming10; -import edac.ReedSolomon_63_47_17; - public class LDU2Message extends LDUMessage { private final static Logger mLog = LoggerFactory.getLogger( LDU2Message.class ); @@ -60,8 +58,7 @@ public class LDU2Message extends LDUMessage public static final ReedSolomon_63_47_17 mReedSolomonDecoder = new ReedSolomon_63_47_17( 4 ); - public LDU2Message( BinaryMessage message, DataUnitID duid, - AliasList aliasList ) + public LDU2Message( BinaryMessage message, DataUnitID duid, AliasList aliasList ) { super( message, duid, aliasList ); @@ -100,7 +97,7 @@ public class LDU2Message extends LDUMessage } /* Reed-Solomon( 24,16,9 ) error detection and correction - * Check the Reed-Solomon parity bits. The RS decoder expects the code + * Check the Reed-Solomon parity bits. The RS decoder expects the code * words and reed solomon parity hex codewords in reverse order. * * Since this is a truncated RS(63) codes, we pad the code with zeros */ diff --git a/src/module/decode/p25/message/ldu/LDUMessage.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/LDUMessage.java similarity index 90% rename from src/module/decode/p25/message/ldu/LDUMessage.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/LDUMessage.java index 6433afd0..149f7dc2 100644 --- a/src/module/decode/p25/message/ldu/LDUMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/LDUMessage.java @@ -1,16 +1,14 @@ -package module.decode.p25.message.ldu; - -import java.util.ArrayList; -import java.util.List; - -import module.decode.p25.message.P25Message; -import module.decode.p25.reference.DataUnitID; +package io.github.dsheirer.module.decode.p25.message.ldu; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.P25Message; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import alias.AliasList; -import bits.BinaryMessage; +import java.util.ArrayList; +import java.util.List; public abstract class LDUMessage extends P25Message { @@ -69,7 +67,7 @@ public abstract class LDUMessage extends P25Message /** * Returns a 162 byte array containing 9 IMBE voice frames of 18-bytes - * (144-bits) each. Each frame is intact as transmitted and requires + * (144-bits) each. Each frame is intact as transmitted and requires * deinterleaving, error correction, derandomizing, etc. */ public List getIMBEFrames() diff --git a/src/module/decode/p25/message/ldu/lc/AdjacentSiteStatusBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/AdjacentSiteStatusBroadcast.java similarity index 89% rename from src/module/decode/p25/message/ldu/lc/AdjacentSiteStatusBroadcast.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/AdjacentSiteStatusBroadcast.java index a8dca0b9..c1684e42 100644 --- a/src/module/decode/p25/message/ldu/lc/AdjacentSiteStatusBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/AdjacentSiteStatusBroadcast.java @@ -16,14 +16,14 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.ldu.lc; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; -import module.decode.p25.message.IAdjacentSite; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.message.tsbk.osp.control.SystemService; -import module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.message.IAdjacentSite; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SystemService; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class AdjacentSiteStatusBroadcast extends LDU1Message implements IdentifierReceiver, IAdjacentSite { diff --git a/src/module/decode/p25/message/ldu/lc/AdjacentSiteStatusBroadcastExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/AdjacentSiteStatusBroadcastExplicit.java similarity index 91% rename from src/module/decode/p25/message/ldu/lc/AdjacentSiteStatusBroadcastExplicit.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/AdjacentSiteStatusBroadcastExplicit.java index c798598c..7543f785 100644 --- a/src/module/decode/p25/message/ldu/lc/AdjacentSiteStatusBroadcastExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/AdjacentSiteStatusBroadcastExplicit.java @@ -16,13 +16,13 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.ldu.lc; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; -import module.decode.p25.message.IAdjacentSite; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.message.IAdjacentSite; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class AdjacentSiteStatusBroadcastExplicit extends LDU1Message implements IdentifierReceiver, IAdjacentSite { diff --git a/src/module/decode/p25/message/ldu/lc/CallAlert.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/CallAlert.java similarity index 83% rename from src/module/decode/p25/message/ldu/lc/CallAlert.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/CallAlert.java index becfe19f..034b1dcd 100644 --- a/src/module/decode/p25/message/ldu/lc/CallAlert.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/CallAlert.java @@ -1,7 +1,7 @@ -package module.decode.p25.message.ldu.lc; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class CallAlert extends LDU1Message { diff --git a/src/module/decode/p25/message/ldu/lc/CallTermination.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/CallTermination.java similarity index 78% rename from src/module/decode/p25/message/ldu/lc/CallTermination.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/CallTermination.java index 9d567b0b..7bc4e929 100644 --- a/src/module/decode/p25/message/ldu/lc/CallTermination.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/CallTermination.java @@ -1,7 +1,7 @@ -package module.decode.p25.message.ldu.lc; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class CallTermination extends LDU1Message { diff --git a/src/module/decode/p25/message/ldu/lc/ChannelIdentifierUpdate.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/ChannelIdentifierUpdate.java similarity index 92% rename from src/module/decode/p25/message/ldu/lc/ChannelIdentifierUpdate.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/ChannelIdentifierUpdate.java index 9c8ef923..8654d9e5 100644 --- a/src/module/decode/p25/message/ldu/lc/ChannelIdentifierUpdate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/ChannelIdentifierUpdate.java @@ -16,11 +16,11 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.ldu.lc; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class ChannelIdentifierUpdate extends LDU1Message implements IBandIdentifier { diff --git a/src/module/decode/p25/message/ldu/lc/ChannelIdentifierUpdateExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/ChannelIdentifierUpdateExplicit.java similarity index 89% rename from src/module/decode/p25/message/ldu/lc/ChannelIdentifierUpdateExplicit.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/ChannelIdentifierUpdateExplicit.java index a1532abf..7945971b 100644 --- a/src/module/decode/p25/message/ldu/lc/ChannelIdentifierUpdateExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/ChannelIdentifierUpdateExplicit.java @@ -1,8 +1,8 @@ -package module.decode.p25.message.ldu.lc; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class ChannelIdentifierUpdateExplicit extends LDU1Message implements IBandIdentifier { diff --git a/src/module/decode/p25/message/ldu/lc/ExtendedFunctionCommand.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/ExtendedFunctionCommand.java similarity index 88% rename from src/module/decode/p25/message/ldu/lc/ExtendedFunctionCommand.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/ExtendedFunctionCommand.java index 28b925ea..77fa4256 100644 --- a/src/module/decode/p25/message/ldu/lc/ExtendedFunctionCommand.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/ExtendedFunctionCommand.java @@ -1,9 +1,8 @@ -package module.decode.p25.message.ldu.lc; - -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.reference.ExtendedFunction; -import module.decode.p25.reference.LinkControlOpcode; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.reference.ExtendedFunction; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/ldu/lc/GroupAffiliationQuery.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/GroupAffiliationQuery.java similarity index 85% rename from src/module/decode/p25/message/ldu/lc/GroupAffiliationQuery.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/GroupAffiliationQuery.java index 5f0a8b4a..71257357 100644 --- a/src/module/decode/p25/message/ldu/lc/GroupAffiliationQuery.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/GroupAffiliationQuery.java @@ -1,8 +1,7 @@ -package module.decode.p25.message.ldu.lc; - -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.reference.LinkControlOpcode; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/ldu/lc/GroupVoiceChannelUpdate.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/GroupVoiceChannelUpdate.java similarity index 93% rename from src/module/decode/p25/message/ldu/lc/GroupVoiceChannelUpdate.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/GroupVoiceChannelUpdate.java index d9b54839..0f2580b6 100644 --- a/src/module/decode/p25/message/ldu/lc/GroupVoiceChannelUpdate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/GroupVoiceChannelUpdate.java @@ -16,12 +16,12 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.ldu.lc; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class GroupVoiceChannelUpdate extends LDU1Message implements IdentifierReceiver { diff --git a/src/module/decode/p25/message/ldu/lc/GroupVoiceChannelUpdateExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/GroupVoiceChannelUpdateExplicit.java similarity index 93% rename from src/module/decode/p25/message/ldu/lc/GroupVoiceChannelUpdateExplicit.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/GroupVoiceChannelUpdateExplicit.java index be2dfda5..91cc6eaa 100644 --- a/src/module/decode/p25/message/ldu/lc/GroupVoiceChannelUpdateExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/GroupVoiceChannelUpdateExplicit.java @@ -16,12 +16,12 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.ldu.lc; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class GroupVoiceChannelUpdateExplicit extends LDU1Message implements IdentifierReceiver { diff --git a/src/module/decode/p25/message/ldu/lc/GroupVoiceChannelUser.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/GroupVoiceChannelUser.java similarity index 90% rename from src/module/decode/p25/message/ldu/lc/GroupVoiceChannelUser.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/GroupVoiceChannelUser.java index c950bcc8..91a3d306 100644 --- a/src/module/decode/p25/message/ldu/lc/GroupVoiceChannelUser.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/GroupVoiceChannelUser.java @@ -1,8 +1,7 @@ -package module.decode.p25.message.ldu.lc; - -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.reference.LinkControlOpcode; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/ldu/lc/LDULCMessageFactory.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/LDULCMessageFactory.java similarity index 92% rename from src/module/decode/p25/message/ldu/lc/LDULCMessageFactory.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/LDULCMessageFactory.java index f6e053a1..de4ef637 100644 --- a/src/module/decode/p25/message/ldu/lc/LDULCMessageFactory.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/LDULCMessageFactory.java @@ -1,8 +1,7 @@ -package module.decode.p25.message.ldu.lc; - -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.reference.Vendor; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.reference.Vendor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -16,7 +15,7 @@ public class LDULCMessageFactory * Constructs a new sub-class of the TDULC message if the opcode is recognized * or returns the original message. */ - public static LDU1Message getMessage( LDU1Message message ) + public static LDU1Message getMessage(LDU1Message message ) { if( message.isImplicitFormat() || message.getVendor() == Vendor.STANDARD ) { diff --git a/src/module/decode/p25/message/ldu/lc/MessageUpdate.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/MessageUpdate.java similarity index 87% rename from src/module/decode/p25/message/ldu/lc/MessageUpdate.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/MessageUpdate.java index bfcc239d..f4668f99 100644 --- a/src/module/decode/p25/message/ldu/lc/MessageUpdate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/MessageUpdate.java @@ -1,8 +1,7 @@ -package module.decode.p25.message.ldu.lc; - -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.reference.LinkControlOpcode; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/ldu/lc/NetworkStatusBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/NetworkStatusBroadcast.java similarity index 89% rename from src/module/decode/p25/message/ldu/lc/NetworkStatusBroadcast.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/NetworkStatusBroadcast.java index ae8091d9..528439e5 100644 --- a/src/module/decode/p25/message/ldu/lc/NetworkStatusBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/NetworkStatusBroadcast.java @@ -16,13 +16,13 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.ldu.lc; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.reference.LinkControlOpcode; -import module.decode.p25.reference.Service; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.reference.Service; public class NetworkStatusBroadcast extends LDU1Message implements IdentifierReceiver { diff --git a/src/module/decode/p25/message/ldu/lc/NetworkStatusBroadcastExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/NetworkStatusBroadcastExplicit.java similarity index 92% rename from src/module/decode/p25/message/ldu/lc/NetworkStatusBroadcastExplicit.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/NetworkStatusBroadcastExplicit.java index abfa7c92..b51bf9d0 100644 --- a/src/module/decode/p25/message/ldu/lc/NetworkStatusBroadcastExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/NetworkStatusBroadcastExplicit.java @@ -16,14 +16,12 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.ldu.lc; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.reference.LinkControlOpcode; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class NetworkStatusBroadcastExplicit extends LDU1Message implements IdentifierReceiver { diff --git a/src/module/decode/p25/message/ldu/lc/ProtectionParameterBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/ProtectionParameterBroadcast.java similarity index 84% rename from src/module/decode/p25/message/ldu/lc/ProtectionParameterBroadcast.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/ProtectionParameterBroadcast.java index 2cf1c570..3bb551d0 100644 --- a/src/module/decode/p25/message/ldu/lc/ProtectionParameterBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/ProtectionParameterBroadcast.java @@ -1,9 +1,8 @@ -package module.decode.p25.message.ldu.lc; - -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.reference.Encryption; -import module.decode.p25.reference.LinkControlOpcode; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.reference.Encryption; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/ldu/lc/RFSSStatusBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/RFSSStatusBroadcast.java similarity index 89% rename from src/module/decode/p25/message/ldu/lc/RFSSStatusBroadcast.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/RFSSStatusBroadcast.java index 02b6017d..bae98a54 100644 --- a/src/module/decode/p25/message/ldu/lc/RFSSStatusBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/RFSSStatusBroadcast.java @@ -16,13 +16,13 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.ldu.lc; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.message.tsbk.osp.control.SystemService; -import module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SystemService; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class RFSSStatusBroadcast extends LDU1Message implements IdentifierReceiver { diff --git a/src/module/decode/p25/message/ldu/lc/RFSSStatusBroadcastExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/RFSSStatusBroadcastExplicit.java similarity index 91% rename from src/module/decode/p25/message/ldu/lc/RFSSStatusBroadcastExplicit.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/RFSSStatusBroadcastExplicit.java index 54b813d5..17c5a9d6 100644 --- a/src/module/decode/p25/message/ldu/lc/RFSSStatusBroadcastExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/RFSSStatusBroadcastExplicit.java @@ -16,15 +16,13 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.ldu.lc; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.message.tsbk.osp.control.SystemService; -import module.decode.p25.reference.LinkControlOpcode; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SystemService; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class RFSSStatusBroadcastExplicit extends LDU1Message implements IdentifierReceiver { diff --git a/src/module/decode/p25/message/ldu/lc/SecondaryControlChannelBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/SecondaryControlChannelBroadcast.java similarity index 91% rename from src/module/decode/p25/message/ldu/lc/SecondaryControlChannelBroadcast.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/SecondaryControlChannelBroadcast.java index e275d0fa..6beae5d3 100644 --- a/src/module/decode/p25/message/ldu/lc/SecondaryControlChannelBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/SecondaryControlChannelBroadcast.java @@ -16,13 +16,13 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.ldu.lc; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.message.tsbk.osp.control.SystemService; -import module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SystemService; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class SecondaryControlChannelBroadcast extends LDU1Message implements IdentifierReceiver { diff --git a/src/module/decode/p25/message/ldu/lc/SecondaryControlChannelBroadcastExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/SecondaryControlChannelBroadcastExplicit.java similarity index 91% rename from src/module/decode/p25/message/ldu/lc/SecondaryControlChannelBroadcastExplicit.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/SecondaryControlChannelBroadcastExplicit.java index 00ae9b8c..408d651c 100644 --- a/src/module/decode/p25/message/ldu/lc/SecondaryControlChannelBroadcastExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/SecondaryControlChannelBroadcastExplicit.java @@ -16,13 +16,13 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.ldu.lc; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.message.tsbk.osp.control.SystemService; -import module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SystemService; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class SecondaryControlChannelBroadcastExplicit extends LDU1Message implements IdentifierReceiver { diff --git a/src/module/decode/p25/message/ldu/lc/StatusQuery.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/StatusQuery.java similarity index 84% rename from src/module/decode/p25/message/ldu/lc/StatusQuery.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/StatusQuery.java index c00c29e6..7db8e146 100644 --- a/src/module/decode/p25/message/ldu/lc/StatusQuery.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/StatusQuery.java @@ -1,8 +1,7 @@ -package module.decode.p25.message.ldu.lc; - -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.reference.LinkControlOpcode; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/ldu/lc/StatusUpdate.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/StatusUpdate.java similarity index 88% rename from src/module/decode/p25/message/ldu/lc/StatusUpdate.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/StatusUpdate.java index ceced2df..5d7c878c 100644 --- a/src/module/decode/p25/message/ldu/lc/StatusUpdate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/StatusUpdate.java @@ -1,8 +1,7 @@ -package module.decode.p25.message.ldu.lc; - -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.reference.LinkControlOpcode; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/ldu/lc/SystemServiceBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/SystemServiceBroadcast.java similarity index 85% rename from src/module/decode/p25/message/ldu/lc/SystemServiceBroadcast.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/SystemServiceBroadcast.java index c030f00d..de530908 100644 --- a/src/module/decode/p25/message/ldu/lc/SystemServiceBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/SystemServiceBroadcast.java @@ -1,14 +1,13 @@ -package module.decode.p25.message.ldu.lc; - -import java.util.List; - -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.reference.LinkControlOpcode; -import module.decode.p25.reference.Service; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.reference.Service; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.List; + public class SystemServiceBroadcast extends LDU1Message { private final static Logger mLog = diff --git a/src/module/decode/p25/message/ldu/lc/TelephoneInterconnectAnswerRequest.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/TelephoneInterconnectAnswerRequest.java similarity index 90% rename from src/module/decode/p25/message/ldu/lc/TelephoneInterconnectAnswerRequest.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/TelephoneInterconnectAnswerRequest.java index c035c931..776f8ba6 100644 --- a/src/module/decode/p25/message/ldu/lc/TelephoneInterconnectAnswerRequest.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/TelephoneInterconnectAnswerRequest.java @@ -1,15 +1,14 @@ -package module.decode.p25.message.ldu.lc; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; + +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.reference.Digit; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.List; -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.reference.Digit; -import module.decode.p25.reference.LinkControlOpcode; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class TelephoneInterconnectAnswerRequest extends LDU1Message { private final static Logger mLog = LoggerFactory.getLogger( diff --git a/src/module/decode/p25/message/ldu/lc/TelephoneInterconnectVoiceChannelUser.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/TelephoneInterconnectVoiceChannelUser.java similarity index 91% rename from src/module/decode/p25/message/ldu/lc/TelephoneInterconnectVoiceChannelUser.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/TelephoneInterconnectVoiceChannelUser.java index 09cd49ae..9753c197 100644 --- a/src/module/decode/p25/message/ldu/lc/TelephoneInterconnectVoiceChannelUser.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/TelephoneInterconnectVoiceChannelUser.java @@ -1,8 +1,7 @@ -package module.decode.p25.message.ldu.lc; - -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.reference.LinkControlOpcode; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/ldu/lc/UnitAuthenticationCommand.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/UnitAuthenticationCommand.java similarity index 88% rename from src/module/decode/p25/message/ldu/lc/UnitAuthenticationCommand.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/UnitAuthenticationCommand.java index 6b4843aa..cfd952f3 100644 --- a/src/module/decode/p25/message/ldu/lc/UnitAuthenticationCommand.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/UnitAuthenticationCommand.java @@ -1,8 +1,7 @@ -package module.decode.p25.message.ldu.lc; - -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.reference.LinkControlOpcode; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/ldu/lc/UnitRegistrationCommand.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/UnitRegistrationCommand.java similarity index 88% rename from src/module/decode/p25/message/ldu/lc/UnitRegistrationCommand.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/UnitRegistrationCommand.java index 34c37c34..1ee90d23 100644 --- a/src/module/decode/p25/message/ldu/lc/UnitRegistrationCommand.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/UnitRegistrationCommand.java @@ -1,8 +1,7 @@ -package module.decode.p25.message.ldu.lc; - -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.reference.LinkControlOpcode; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/ldu/lc/UnitToUnitAnswerRequest.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/UnitToUnitAnswerRequest.java similarity index 77% rename from src/module/decode/p25/message/ldu/lc/UnitToUnitAnswerRequest.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/UnitToUnitAnswerRequest.java index 297a7c19..45a1fdbc 100644 --- a/src/module/decode/p25/message/ldu/lc/UnitToUnitAnswerRequest.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/UnitToUnitAnswerRequest.java @@ -1,8 +1,8 @@ -package module.decode.p25.message.ldu.lc; - -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.reference.LinkControlOpcode; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; +import io.github.dsheirer.module.decode.p25.message.P25Message; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -64,15 +64,15 @@ public class UnitToUnitAnswerRequest extends LDU1Message return mMessage.get( ENCRYPTED_CHANNEL_FLAG ); } - public DuplexMode getDuplexMode() + public P25Message.DuplexMode getDuplexMode() { - return mMessage.get( DUPLEX_MODE ) ? DuplexMode.FULL : DuplexMode.HALF; + return mMessage.get( DUPLEX_MODE ) ? P25Message.DuplexMode.FULL : P25Message.DuplexMode.HALF; } - public SessionMode getSessionMode() + public P25Message.SessionMode getSessionMode() { return mMessage.get( SESSION_MODE ) ? - SessionMode.CIRCUIT : SessionMode.PACKET; + P25Message.SessionMode.CIRCUIT : P25Message.SessionMode.PACKET; } public String getTargetAddress() diff --git a/src/module/decode/p25/message/ldu/lc/UnitToUnitVoiceChannelUser.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/UnitToUnitVoiceChannelUser.java similarity index 91% rename from src/module/decode/p25/message/ldu/lc/UnitToUnitVoiceChannelUser.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/UnitToUnitVoiceChannelUser.java index 70da5b3f..ab26df62 100644 --- a/src/module/decode/p25/message/ldu/lc/UnitToUnitVoiceChannelUser.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/UnitToUnitVoiceChannelUser.java @@ -1,8 +1,7 @@ -package module.decode.p25.message.ldu.lc; - -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.reference.LinkControlOpcode; +package io.github.dsheirer.module.decode.p25.message.ldu.lc; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/ldu/lc/motorola/MotorolaOpcode_0.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/motorola/MotorolaOpcode_0.java similarity index 84% rename from src/module/decode/p25/message/ldu/lc/motorola/MotorolaOpcode_0.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/motorola/MotorolaOpcode_0.java index f9e1a6fc..add7846d 100644 --- a/src/module/decode/p25/message/ldu/lc/motorola/MotorolaOpcode_0.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/motorola/MotorolaOpcode_0.java @@ -1,8 +1,7 @@ -package module.decode.p25.message.ldu.lc.motorola; - -import module.decode.p25.message.ldu.LDU1Message; -import module.decode.p25.reference.LinkControlOpcode; +package io.github.dsheirer.module.decode.p25.message.ldu.lc.motorola; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/pdu/PDUMessage.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/PDUMessage.java similarity index 84% rename from src/module/decode/p25/message/pdu/PDUMessage.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/PDUMessage.java index 6981d673..834cd96c 100644 --- a/src/module/decode/p25/message/pdu/PDUMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/PDUMessage.java @@ -1,15 +1,15 @@ -package module.decode.p25.message.pdu; +package io.github.dsheirer.module.decode.p25.message.pdu; -import module.decode.p25.message.P25Message; -import module.decode.p25.message.tsbk.vendor.VendorOpcode; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import module.decode.p25.reference.PDUFormat; -import module.decode.p25.reference.ServiceAccessPoint; -import module.decode.p25.reference.Vendor; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRC; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRC; +import io.github.dsheirer.module.decode.p25.message.P25Message; +import io.github.dsheirer.module.decode.p25.message.tsbk.vendor.VendorOpcode; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; +import io.github.dsheirer.module.decode.p25.reference.PDUFormat; +import io.github.dsheirer.module.decode.p25.reference.ServiceAccessPoint; +import io.github.dsheirer.module.decode.p25.reference.Vendor; public class PDUMessage extends P25Message { @@ -27,7 +27,7 @@ public class PDUMessage extends P25Message public static final int[] PDU_CRC = { 144,145,146,147,148,149,150,151,152, 153,154,155,156,157,158,159 }; - public PDUMessage( BinaryMessage message, DataUnitID duid, AliasList aliasList ) + public PDUMessage(BinaryMessage message, DataUnitID duid, AliasList aliasList ) { super( message, duid, aliasList ); diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/PDUMessageFactory.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/PDUMessageFactory.java new file mode 100644 index 00000000..4cea5c35 --- /dev/null +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/PDUMessageFactory.java @@ -0,0 +1,131 @@ +package io.github.dsheirer.module.decode.p25.message.pdu; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.control.AdjacentStatusBroadcastExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.control.CallAlertExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.control.GroupAffiliationQueryExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.control.GroupAffiliationResponseExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.control.MessageUpdateExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.control.NetworkStatusBroadcastExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.control.ProtectionParameterBroadcast; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.control.RFSSStatusBroadcastExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.control.RoamingAddressUpdateExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.control.StatusQueryExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.control.StatusUpdateExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.control.UnitRegistrationResponseExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.data.GroupDataChannelGrantExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.data.IndividualDataChannelGrantExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.voice.GroupVoiceChannelGrantExplicit; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.voice.TelephoneInterconnectChannelGrantExplicit; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.voice.TelephoneInterconnectChannelGrantUpdateExplicit; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.voice.UnitToUnitAnswerRequestExplicit; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.voice.UnitToUnitVoiceChannelGrantExtended; +import io.github.dsheirer.module.decode.p25.message.pdu.osp.voice.UnitToUnitVoiceChannelGrantUpdateExtended; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; +import io.github.dsheirer.module.decode.p25.reference.PDUFormat; +import io.github.dsheirer.module.decode.p25.reference.Vendor; + +public class PDUMessageFactory +{ + public static PDUMessage getMessage( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + PDUFormat format = PDUFormat.fromValue( + message.getInt( PDUMessage.FORMAT ) ); + + switch( format ) + { + case ALTERNATE_MULTI_BLOCK_TRUNKING_CONTROL: + Vendor vendor = Vendor.fromValue( + message.getInt( PDUMessage.VENDOR_ID ) ); + + switch( vendor ) + { + case STANDARD: + Opcode opcode = Opcode.fromValue( + message.getInt( PDUMessage.OPCODE ) ); + + switch( opcode ) + { + case ADJACENT_STATUS_BROADCAST: + return new AdjacentStatusBroadcastExtended( + message, duid, aliasList ); + case CALL_ALERT: + return new CallAlertExtended( message, duid, + aliasList ); + case GROUP_AFFILIATION_QUERY: + return new GroupAffiliationQueryExtended( + message, duid, aliasList ); + case GROUP_AFFILIATION_RESPONSE: + return new GroupAffiliationResponseExtended( + message, duid, aliasList ); + case GROUP_DATA_CHANNEL_GRANT: + return new GroupDataChannelGrantExtended( + message, duid, aliasList ); + case GROUP_VOICE_CHANNEL_GRANT: + + return new GroupVoiceChannelGrantExplicit( + message, duid, aliasList ); + case INDIVIDUAL_DATA_CHANNEL_GRANT: + return new IndividualDataChannelGrantExtended( + message, duid, aliasList ); + case MESSAGE_UPDATE: + return new MessageUpdateExtended( message, duid, + aliasList ); + case NETWORK_STATUS_BROADCAST: + return new NetworkStatusBroadcastExtended( + message, duid, aliasList ); + case PROTECTION_PARAMETER_BROADCAST: + return new ProtectionParameterBroadcast( + message, duid, aliasList ); + case RFSS_STATUS_BROADCAST: + return new RFSSStatusBroadcastExtended( message, + duid, aliasList ); + case ROAMING_ADDRESS_UPDATE: + return new RoamingAddressUpdateExtended( + message, duid, aliasList ); + case STATUS_QUERY: + return new StatusQueryExtended( message, duid, + aliasList ); + case STATUS_UPDATE: + return new StatusUpdateExtended( message, duid, + aliasList ); + case TELEPHONE_INTERCONNECT_VOICE_CHANNEL_GRANT: + return new TelephoneInterconnectChannelGrantExplicit( + message, duid, aliasList ); + case TELEPHONE_INTERCONNECT_VOICE_CHANNEL_GRANT_UPDATE: + return new TelephoneInterconnectChannelGrantUpdateExplicit( + message, duid, aliasList ); + case UNIT_REGISTRATION_RESPONSE: + return new UnitRegistrationResponseExtended( + message, duid, aliasList ); + case UNIT_TO_UNIT_ANSWER_REQUEST: + return new UnitToUnitAnswerRequestExplicit( + message, duid, aliasList ); + case UNIT_TO_UNIT_VOICE_CHANNEL_GRANT: + return new UnitToUnitVoiceChannelGrantExtended( + message, duid, aliasList ); + case UNIT_TO_UNIT_VOICE_CHANNEL_GRANT_UPDATE: + return new UnitToUnitVoiceChannelGrantUpdateExtended( + message, duid, aliasList ); + default: + break; + } + case MOTOROLA: + break; + default: + break; + } + + return new PDUMessage( message, duid, aliasList ); + + case UNCONFIRMED_MULTI_BLOCK_TRUNKING_CONTROL: + return new PDUMessage( message, duid, aliasList ); + default: + return new PDUMessage( message, duid, aliasList ); + } + } +} diff --git a/src/module/decode/p25/message/pdu/UnitToUnitChannelGrantExtended.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/UnitToUnitChannelGrantExtended.java similarity index 94% rename from src/module/decode/p25/message/pdu/UnitToUnitChannelGrantExtended.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/UnitToUnitChannelGrantExtended.java index 29bd9bc4..3c72f0f6 100644 --- a/src/module/decode/p25/message/pdu/UnitToUnitChannelGrantExtended.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/UnitToUnitChannelGrantExtended.java @@ -16,14 +16,14 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.pdu; +package io.github.dsheirer.module.decode.p25.message.pdu; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRCP25; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRCP25; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; public abstract class UnitToUnitChannelGrantExtended extends PDUMessage implements IdentifierReceiver { diff --git a/src/module/decode/p25/message/pdu/confirmed/PDUConfirmedMessage.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/PDUConfirmedMessage.java similarity index 90% rename from src/module/decode/p25/message/pdu/confirmed/PDUConfirmedMessage.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/PDUConfirmedMessage.java index 174c9466..41f362ea 100644 --- a/src/module/decode/p25/message/pdu/confirmed/PDUConfirmedMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/PDUConfirmedMessage.java @@ -1,18 +1,16 @@ -package module.decode.p25.message.pdu.confirmed; - -import module.decode.p25.message.pdu.PDUMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.PDUType; -import module.decode.p25.reference.Vendor; +package io.github.dsheirer.module.decode.p25.message.pdu.confirmed; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRC; +import io.github.dsheirer.edac.CRCP25; +import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.PDUType; +import io.github.dsheirer.module.decode.p25.reference.Vendor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRC; -import edac.CRCP25; - public class PDUConfirmedMessage extends PDUMessage { public final static Logger mLog = diff --git a/src/module/decode/p25/message/pdu/confirmed/PDUConfirmedMessageFactory.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/PDUConfirmedMessageFactory.java similarity index 96% rename from src/module/decode/p25/message/pdu/confirmed/PDUConfirmedMessageFactory.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/PDUConfirmedMessageFactory.java index 84fbf3ec..0459cfa3 100644 --- a/src/module/decode/p25/message/pdu/confirmed/PDUConfirmedMessageFactory.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/PDUConfirmedMessageFactory.java @@ -1,4 +1,4 @@ -package module.decode.p25.message.pdu.confirmed; +package io.github.dsheirer.module.decode.p25.message.pdu.confirmed; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/pdu/confirmed/PDUTypeUnknown.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/PDUTypeUnknown.java similarity index 94% rename from src/module/decode/p25/message/pdu/confirmed/PDUTypeUnknown.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/PDUTypeUnknown.java index 0f08ca73..26b04ce2 100644 --- a/src/module/decode/p25/message/pdu/confirmed/PDUTypeUnknown.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/PDUTypeUnknown.java @@ -1,4 +1,4 @@ -package module.decode.p25.message.pdu.confirmed; +package io.github.dsheirer.module.decode.p25.message.pdu.confirmed; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/pdu/confirmed/PacketData.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/PacketData.java similarity index 88% rename from src/module/decode/p25/message/pdu/confirmed/PacketData.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/PacketData.java index e1b0af6d..c07f556b 100644 --- a/src/module/decode/p25/message/pdu/confirmed/PacketData.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/PacketData.java @@ -1,11 +1,10 @@ -package module.decode.p25.message.pdu.confirmed; +package io.github.dsheirer.module.decode.p25.message.pdu.confirmed; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import alias.AliasList; -import bits.BinaryMessage; - public class PacketData extends PDUConfirmedMessage { public final static Logger mLog = diff --git a/src/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextAccept.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextAccept.java similarity index 97% rename from src/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextAccept.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextAccept.java index 41a5a77a..11ed37b6 100644 --- a/src/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextAccept.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextAccept.java @@ -1,7 +1,6 @@ -package module.decode.p25.message.pdu.confirmed; - -import module.decode.p25.reference.MDPConfigurationOption; +package io.github.dsheirer.module.decode.p25.message.pdu.confirmed; +import io.github.dsheirer.module.decode.p25.reference.MDPConfigurationOption; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextReject.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextReject.java similarity index 89% rename from src/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextReject.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextReject.java index e9a56414..ecc52b37 100644 --- a/src/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextReject.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextReject.java @@ -1,7 +1,6 @@ -package module.decode.p25.message.pdu.confirmed; - -import module.decode.p25.reference.SNDCPActivationRejectReason; +package io.github.dsheirer.module.decode.p25.message.pdu.confirmed; +import io.github.dsheirer.module.decode.p25.reference.SNDCPActivationRejectReason; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextRequest.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextRequest.java similarity index 96% rename from src/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextRequest.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextRequest.java index ba7966dd..ea6e53bd 100644 --- a/src/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextRequest.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextRequest.java @@ -1,7 +1,6 @@ -package module.decode.p25.message.pdu.confirmed; - -import module.decode.p25.reference.MDPConfigurationOption; +package io.github.dsheirer.module.decode.p25.message.pdu.confirmed; +import io.github.dsheirer.module.decode.p25.reference.MDPConfigurationOption; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/pdu/confirmed/SNDCPDeactivateTDSContext.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/SNDCPDeactivateTDSContext.java similarity index 91% rename from src/module/decode/p25/message/pdu/confirmed/SNDCPDeactivateTDSContext.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/SNDCPDeactivateTDSContext.java index ec8ec0b5..62310317 100644 --- a/src/module/decode/p25/message/pdu/confirmed/SNDCPDeactivateTDSContext.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/SNDCPDeactivateTDSContext.java @@ -1,7 +1,6 @@ -package module.decode.p25.message.pdu.confirmed; - -import module.decode.p25.reference.PDUType; +package io.github.dsheirer.module.decode.p25.message.pdu.confirmed; +import io.github.dsheirer.module.decode.p25.reference.PDUType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/pdu/confirmed/SNDCPUserData.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/SNDCPUserData.java similarity index 97% rename from src/module/decode/p25/message/pdu/confirmed/SNDCPUserData.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/SNDCPUserData.java index 072e5a24..5ba57e42 100644 --- a/src/module/decode/p25/message/pdu/confirmed/SNDCPUserData.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/SNDCPUserData.java @@ -1,8 +1,7 @@ -package module.decode.p25.message.pdu.confirmed; - -import module.decode.p25.reference.IPHeaderCompression; -import module.decode.p25.reference.IPProtocol; +package io.github.dsheirer.module.decode.p25.message.pdu.confirmed; +import io.github.dsheirer.module.decode.p25.reference.IPHeaderCompression; +import io.github.dsheirer.module.decode.p25.reference.IPProtocol; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/pdu/osp/control/AdjacentStatusBroadcastExtended.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/AdjacentStatusBroadcastExtended.java similarity index 89% rename from src/module/decode/p25/message/pdu/osp/control/AdjacentStatusBroadcastExtended.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/AdjacentStatusBroadcastExtended.java index 3fd3dce1..661c2f64 100644 --- a/src/module/decode/p25/message/pdu/osp/control/AdjacentStatusBroadcastExtended.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/AdjacentStatusBroadcastExtended.java @@ -16,18 +16,18 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.pdu.osp.control; +package io.github.dsheirer.module.decode.p25.message.pdu.osp.control; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRCP25; -import module.decode.p25.message.IAdjacentSite; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.pdu.PDUMessage; -import module.decode.p25.message.tsbk.osp.control.SystemService; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRCP25; +import io.github.dsheirer.module.decode.p25.message.IAdjacentSite; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SystemService; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; public class AdjacentStatusBroadcastExtended extends PDUMessage implements IdentifierReceiver, IAdjacentSite { diff --git a/src/module/decode/p25/message/pdu/osp/control/CallAlertExtended.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/CallAlertExtended.java similarity index 78% rename from src/module/decode/p25/message/pdu/osp/control/CallAlertExtended.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/CallAlertExtended.java index ef23c505..c212df94 100644 --- a/src/module/decode/p25/message/pdu/osp/control/CallAlertExtended.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/CallAlertExtended.java @@ -1,13 +1,13 @@ -package module.decode.p25.message.pdu.osp.control; +package io.github.dsheirer.module.decode.p25.message.pdu.osp.control; -import module.decode.p25.message.pdu.PDUMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRCP25; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRCP25; +import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; -public class CallAlertExtended extends PDUMessage +public class CallAlertExtended extends PDUMessage { public static final int[] TARGET_ADDRESS = { 88,89,90,91,92,93,94,95,96,97, 98,99,100,101,102,103,104,105,106,107,108,109,110,111 }; @@ -21,8 +21,7 @@ public class CallAlertExtended extends PDUMessage 230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247, 248,249,250,251,252,253,254,255 }; - public CallAlertExtended( BinaryMessage message, - DataUnitID duid, AliasList aliasList ) + public CallAlertExtended(BinaryMessage message, DataUnitID duid, AliasList aliasList ) { super( message, duid, aliasList ); diff --git a/src/module/decode/p25/message/pdu/osp/control/GroupAffiliationQueryExtended.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/GroupAffiliationQueryExtended.java similarity index 77% rename from src/module/decode/p25/message/pdu/osp/control/GroupAffiliationQueryExtended.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/GroupAffiliationQueryExtended.java index 0cacd7c2..f4d203ae 100644 --- a/src/module/decode/p25/message/pdu/osp/control/GroupAffiliationQueryExtended.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/GroupAffiliationQueryExtended.java @@ -1,13 +1,13 @@ -package module.decode.p25.message.pdu.osp.control; +package io.github.dsheirer.module.decode.p25.message.pdu.osp.control; -import module.decode.p25.message.pdu.PDUMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRCP25; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRCP25; +import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; -public class GroupAffiliationQueryExtended extends PDUMessage +public class GroupAffiliationQueryExtended extends PDUMessage { public static final int[] TARGET_ADDRESS = { 88,89,90,91,92,93,94,95,96,97, 98,99,100,101,102,103,104,105,106,107,108,109,110,111 }; @@ -21,8 +21,7 @@ public class GroupAffiliationQueryExtended extends PDUMessage 230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247, 248,249,250,251,252,253,254,255 }; - public GroupAffiliationQueryExtended( BinaryMessage message, - DataUnitID duid, AliasList aliasList ) + public GroupAffiliationQueryExtended(BinaryMessage message, DataUnitID duid, AliasList aliasList ) { super( message, duid, aliasList ); diff --git a/src/module/decode/p25/message/pdu/osp/control/GroupAffiliationResponseExtended.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/GroupAffiliationResponseExtended.java similarity index 86% rename from src/module/decode/p25/message/pdu/osp/control/GroupAffiliationResponseExtended.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/GroupAffiliationResponseExtended.java index 03daa837..42d95566 100644 --- a/src/module/decode/p25/message/pdu/osp/control/GroupAffiliationResponseExtended.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/GroupAffiliationResponseExtended.java @@ -1,14 +1,14 @@ -package module.decode.p25.message.pdu.osp.control; +package io.github.dsheirer.module.decode.p25.message.pdu.osp.control; -import module.decode.p25.message.pdu.PDUMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import module.decode.p25.reference.Response; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRCP25; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRCP25; +import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; +import io.github.dsheirer.module.decode.p25.reference.Response; -public class GroupAffiliationResponseExtended extends PDUMessage +public class GroupAffiliationResponseExtended extends PDUMessage { public static final int[] TARGET_ADDRESS = { 88,89,90,91,92,93,94,95,96,97, 98,99,100,101,102,103,104,105,106,107,108,109,110,111 }; @@ -31,8 +31,7 @@ public class GroupAffiliationResponseExtended extends PDUMessage 326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342, 343,344,345,346,347,348,349,350,351 }; - public GroupAffiliationResponseExtended( BinaryMessage message, - DataUnitID duid, AliasList aliasList ) + public GroupAffiliationResponseExtended(BinaryMessage message, DataUnitID duid, AliasList aliasList ) { super( message, duid, aliasList ); diff --git a/src/module/decode/p25/message/pdu/osp/control/MessageUpdateExtended.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/MessageUpdateExtended.java similarity index 81% rename from src/module/decode/p25/message/pdu/osp/control/MessageUpdateExtended.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/MessageUpdateExtended.java index cb3bd496..44a8e6d5 100644 --- a/src/module/decode/p25/message/pdu/osp/control/MessageUpdateExtended.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/MessageUpdateExtended.java @@ -1,13 +1,13 @@ -package module.decode.p25.message.pdu.osp.control; +package io.github.dsheirer.module.decode.p25.message.pdu.osp.control; -import module.decode.p25.message.pdu.PDUMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRCP25; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRCP25; +import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; -public class MessageUpdateExtended extends PDUMessage +public class MessageUpdateExtended extends PDUMessage { public static final int[] TARGET_ADDRESS = { 88,89,90,91,92,93,94,95,96,97, 98,99,100,101,102,103,104,105,106,107,108,109,110,111 }; @@ -23,8 +23,7 @@ public class MessageUpdateExtended extends PDUMessage 230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247, 248,249,250,251,252,253,254,255 }; - public MessageUpdateExtended( BinaryMessage message, - DataUnitID duid, AliasList aliasList ) + public MessageUpdateExtended(BinaryMessage message, DataUnitID duid, AliasList aliasList ) { super( message, duid, aliasList ); diff --git a/src/module/decode/p25/message/pdu/osp/control/NetworkStatusBroadcastExtended.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/NetworkStatusBroadcastExtended.java similarity index 88% rename from src/module/decode/p25/message/pdu/osp/control/NetworkStatusBroadcastExtended.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/NetworkStatusBroadcastExtended.java index fb6b7fbf..1e17466a 100644 --- a/src/module/decode/p25/message/pdu/osp/control/NetworkStatusBroadcastExtended.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/NetworkStatusBroadcastExtended.java @@ -16,18 +16,18 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.pdu.osp.control; +package io.github.dsheirer.module.decode.p25.message.pdu.osp.control; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRCP25; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.pdu.PDUMessage; -import module.decode.p25.message.tsbk.osp.control.SystemService; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import module.decode.p25.reference.P25NetworkCallsign; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRCP25; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SystemService; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; +import io.github.dsheirer.module.decode.p25.reference.P25NetworkCallsign; public class NetworkStatusBroadcastExtended extends PDUMessage implements IdentifierReceiver { diff --git a/src/module/decode/p25/message/pdu/osp/control/ProtectionParameterBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/ProtectionParameterBroadcast.java similarity index 83% rename from src/module/decode/p25/message/pdu/osp/control/ProtectionParameterBroadcast.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/ProtectionParameterBroadcast.java index a983bbf0..e0325000 100644 --- a/src/module/decode/p25/message/pdu/osp/control/ProtectionParameterBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/ProtectionParameterBroadcast.java @@ -1,14 +1,14 @@ -package module.decode.p25.message.pdu.osp.control; +package io.github.dsheirer.module.decode.p25.message.pdu.osp.control; -import module.decode.p25.message.pdu.PDUMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Encryption; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRCP25; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRCP25; +import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Encryption; +import io.github.dsheirer.module.decode.p25.reference.Opcode; -public class ProtectionParameterBroadcast extends PDUMessage +public class ProtectionParameterBroadcast extends PDUMessage { public static final int[] TARGET_ADDRESS = { 88,89,90,91,92,93,94,95,96,97, 98,99,100,101,102,103,104,105,106,107,108,109,110,111 }; @@ -35,8 +35,8 @@ public class ProtectionParameterBroadcast extends PDUMessage 326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342, 343,344,345,346,347,348,349,350,351 }; - public ProtectionParameterBroadcast( BinaryMessage message, - DataUnitID duid, AliasList aliasList ) + public ProtectionParameterBroadcast(BinaryMessage message, + DataUnitID duid, AliasList aliasList ) { super( message, duid, aliasList ); diff --git a/src/module/decode/p25/message/pdu/osp/control/RFSSStatusBroadcastExtended.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/RFSSStatusBroadcastExtended.java similarity index 89% rename from src/module/decode/p25/message/pdu/osp/control/RFSSStatusBroadcastExtended.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/RFSSStatusBroadcastExtended.java index 94ee8608..b97ecb66 100644 --- a/src/module/decode/p25/message/pdu/osp/control/RFSSStatusBroadcastExtended.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/RFSSStatusBroadcastExtended.java @@ -16,17 +16,17 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.pdu.osp.control; +package io.github.dsheirer.module.decode.p25.message.pdu.osp.control; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRCP25; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.pdu.PDUMessage; -import module.decode.p25.message.tsbk.osp.control.SystemService; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRCP25; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SystemService; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; public class RFSSStatusBroadcastExtended extends PDUMessage implements IdentifierReceiver { diff --git a/src/module/decode/p25/message/pdu/osp/control/RoamingAddressUpdateExtended.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/RoamingAddressUpdateExtended.java similarity index 92% rename from src/module/decode/p25/message/pdu/osp/control/RoamingAddressUpdateExtended.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/RoamingAddressUpdateExtended.java index 72353452..c60184e0 100644 --- a/src/module/decode/p25/message/pdu/osp/control/RoamingAddressUpdateExtended.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/RoamingAddressUpdateExtended.java @@ -1,14 +1,14 @@ -package module.decode.p25.message.pdu.osp.control; +package io.github.dsheirer.module.decode.p25.message.pdu.osp.control; -import module.decode.p25.P25MessageFramer; -import module.decode.p25.message.pdu.PDUMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRCP25; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRCP25; +import io.github.dsheirer.module.decode.p25.P25MessageFramer; +import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; -public class RoamingAddressUpdateExtended extends PDUMessage +public class RoamingAddressUpdateExtended extends PDUMessage { public static final int[] TARGET_ADDRESS = { 88,89,90,91,92,93,94,95,96,97, 98,99,100,101,102,103,104,105,106,107,108,109,110,111 }; @@ -62,8 +62,8 @@ public class RoamingAddressUpdateExtended extends PDUMessage private Format mFormat; - public RoamingAddressUpdateExtended( BinaryMessage message, - DataUnitID duid, AliasList aliasList ) + public RoamingAddressUpdateExtended(BinaryMessage message, + DataUnitID duid, AliasList aliasList ) { super( message, duid, aliasList ); diff --git a/src/module/decode/p25/message/pdu/osp/control/StatusQueryExtended.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/StatusQueryExtended.java similarity index 84% rename from src/module/decode/p25/message/pdu/osp/control/StatusQueryExtended.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/StatusQueryExtended.java index decb3a26..df3a3dc0 100644 --- a/src/module/decode/p25/message/pdu/osp/control/StatusQueryExtended.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/StatusQueryExtended.java @@ -1,11 +1,11 @@ -package module.decode.p25.message.pdu.osp.control; +package io.github.dsheirer.module.decode.p25.message.pdu.osp.control; -import module.decode.p25.message.pdu.PDUMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRCP25; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRCP25; +import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; public class StatusQueryExtended extends PDUMessage { diff --git a/src/module/decode/p25/message/pdu/osp/control/StatusUpdateExtended.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/StatusUpdateExtended.java similarity index 86% rename from src/module/decode/p25/message/pdu/osp/control/StatusUpdateExtended.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/StatusUpdateExtended.java index 04bc1f4f..280f9dfe 100644 --- a/src/module/decode/p25/message/pdu/osp/control/StatusUpdateExtended.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/StatusUpdateExtended.java @@ -1,11 +1,11 @@ -package module.decode.p25.message.pdu.osp.control; +package io.github.dsheirer.module.decode.p25.message.pdu.osp.control; -import module.decode.p25.message.pdu.PDUMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRCP25; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRCP25; +import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; public class StatusUpdateExtended extends PDUMessage { diff --git a/src/module/decode/p25/message/pdu/osp/control/UnitRegistrationResponseExtended.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/UnitRegistrationResponseExtended.java similarity index 85% rename from src/module/decode/p25/message/pdu/osp/control/UnitRegistrationResponseExtended.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/UnitRegistrationResponseExtended.java index 17670d49..b35a680b 100644 --- a/src/module/decode/p25/message/pdu/osp/control/UnitRegistrationResponseExtended.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/UnitRegistrationResponseExtended.java @@ -1,12 +1,12 @@ -package module.decode.p25.message.pdu.osp.control; +package io.github.dsheirer.module.decode.p25.message.pdu.osp.control; -import module.decode.p25.message.pdu.PDUMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import module.decode.p25.reference.Response; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRCP25; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRCP25; +import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; +import io.github.dsheirer.module.decode.p25.reference.Response; public class UnitRegistrationResponseExtended extends PDUMessage { diff --git a/src/module/decode/p25/message/pdu/osp/data/GroupDataChannelGrantExtended.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/data/GroupDataChannelGrantExtended.java similarity index 91% rename from src/module/decode/p25/message/pdu/osp/data/GroupDataChannelGrantExtended.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/data/GroupDataChannelGrantExtended.java index 4ba2eef4..0913a06a 100644 --- a/src/module/decode/p25/message/pdu/osp/data/GroupDataChannelGrantExtended.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/data/GroupDataChannelGrantExtended.java @@ -16,16 +16,16 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.pdu.osp.data; +package io.github.dsheirer.module.decode.p25.message.pdu.osp.data; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRCP25; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.pdu.PDUMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRCP25; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; public class GroupDataChannelGrantExtended extends PDUMessage implements IdentifierReceiver { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/data/IndividualDataChannelGrantExtended.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/data/IndividualDataChannelGrantExtended.java new file mode 100644 index 00000000..512cb2a2 --- /dev/null +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/data/IndividualDataChannelGrantExtended.java @@ -0,0 +1,22 @@ +package io.github.dsheirer.module.decode.p25.message.pdu.osp.data; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.pdu.UnitToUnitChannelGrantExtended; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class IndividualDataChannelGrantExtended extends UnitToUnitChannelGrantExtended implements IdentifierReceiver +{ + public IndividualDataChannelGrantExtended(BinaryMessage message, DataUnitID duid, AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.INDIVIDUAL_DATA_CHANNEL_GRANT.getDescription(); + } +} diff --git a/src/module/decode/p25/message/pdu/osp/voice/GroupVoiceChannelGrantExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/GroupVoiceChannelGrantExplicit.java similarity index 91% rename from src/module/decode/p25/message/pdu/osp/voice/GroupVoiceChannelGrantExplicit.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/GroupVoiceChannelGrantExplicit.java index d9f41c8a..a5f64ad3 100644 --- a/src/module/decode/p25/message/pdu/osp/voice/GroupVoiceChannelGrantExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/GroupVoiceChannelGrantExplicit.java @@ -16,16 +16,16 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.pdu.osp.voice; +package io.github.dsheirer.module.decode.p25.message.pdu.osp.voice; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRCP25; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.pdu.PDUMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRCP25; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; public class GroupVoiceChannelGrantExplicit extends PDUMessage implements IdentifierReceiver { diff --git a/src/module/decode/p25/message/pdu/osp/voice/TelephoneInterconnectChannelGrantExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/TelephoneInterconnectChannelGrantExplicit.java similarity index 86% rename from src/module/decode/p25/message/pdu/osp/voice/TelephoneInterconnectChannelGrantExplicit.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/TelephoneInterconnectChannelGrantExplicit.java index 0d06ad93..b3b3880d 100644 --- a/src/module/decode/p25/message/pdu/osp/voice/TelephoneInterconnectChannelGrantExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/TelephoneInterconnectChannelGrantExplicit.java @@ -16,16 +16,17 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.pdu.osp.voice; +package io.github.dsheirer.module.decode.p25.message.pdu.osp.voice; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRCP25; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.pdu.PDUMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRCP25; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.P25Message; +import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; import java.util.Date; @@ -103,15 +104,15 @@ public class TelephoneInterconnectChannelGrantExplicit extends PDUMessage implem return mMessage.get(ENCRYPTED_CHANNEL_FLAG); } - public DuplexMode getDuplexMode() + public P25Message.DuplexMode getDuplexMode() { - return mMessage.get(DUPLEX_MODE) ? DuplexMode.FULL : DuplexMode.HALF; + return mMessage.get(DUPLEX_MODE) ? P25Message.DuplexMode.FULL : P25Message.DuplexMode.HALF; } - public SessionMode getSessionMode() + public P25Message.SessionMode getSessionMode() { return mMessage.get(SESSION_MODE) ? - SessionMode.CIRCUIT : SessionMode.PACKET; + P25Message.SessionMode.CIRCUIT : P25Message.SessionMode.PACKET; } public String getAddress() diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/TelephoneInterconnectChannelGrantUpdateExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/TelephoneInterconnectChannelGrantUpdateExplicit.java new file mode 100644 index 00000000..587565ec --- /dev/null +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/TelephoneInterconnectChannelGrantUpdateExplicit.java @@ -0,0 +1,22 @@ +package io.github.dsheirer.module.decode.p25.message.pdu.osp.voice; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class TelephoneInterconnectChannelGrantUpdateExplicit + extends TelephoneInterconnectChannelGrantExplicit +{ + public TelephoneInterconnectChannelGrantUpdateExplicit(BinaryMessage message, + DataUnitID duid, AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.TELEPHONE_INTERCONNECT_VOICE_CHANNEL_GRANT_UPDATE.getDescription(); + } +} diff --git a/src/module/decode/p25/message/pdu/osp/voice/UnitToUnitAnswerRequestExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/UnitToUnitAnswerRequestExplicit.java similarity index 72% rename from src/module/decode/p25/message/pdu/osp/voice/UnitToUnitAnswerRequestExplicit.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/UnitToUnitAnswerRequestExplicit.java index 81ef77ca..39e028c3 100644 --- a/src/module/decode/p25/message/pdu/osp/voice/UnitToUnitAnswerRequestExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/UnitToUnitAnswerRequestExplicit.java @@ -1,13 +1,14 @@ -package module.decode.p25.message.pdu.osp.voice; +package io.github.dsheirer.module.decode.p25.message.pdu.osp.voice; -import module.decode.p25.message.pdu.PDUMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRCP25; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRCP25; +import io.github.dsheirer.module.decode.p25.message.P25Message; +import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; -public class UnitToUnitAnswerRequestExplicit extends PDUMessage +public class UnitToUnitAnswerRequestExplicit extends PDUMessage { /* Service Options */ public static final int EMERGENCY_FLAG = 128; @@ -27,8 +28,8 @@ public class UnitToUnitAnswerRequestExplicit extends PDUMessage 230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247, 248,249,250,251,252,253,254,255 }; - public UnitToUnitAnswerRequestExplicit( BinaryMessage message, - DataUnitID duid, AliasList aliasList ) + public UnitToUnitAnswerRequestExplicit(BinaryMessage message, + DataUnitID duid, AliasList aliasList ) { super( message, duid, aliasList ); @@ -78,15 +79,15 @@ public class UnitToUnitAnswerRequestExplicit extends PDUMessage return mMessage.get( ENCRYPTED_CHANNEL_FLAG ); } - public DuplexMode getDuplexMode() + public P25Message.DuplexMode getDuplexMode() { - return mMessage.get( DUPLEX_MODE ) ? DuplexMode.FULL : DuplexMode.HALF; + return mMessage.get( DUPLEX_MODE ) ? P25Message.DuplexMode.FULL : P25Message.DuplexMode.HALF; } - public SessionMode getSessionMode() + public P25Message.SessionMode getSessionMode() { return mMessage.get( SESSION_MODE ) ? - SessionMode.CIRCUIT : SessionMode.PACKET; + P25Message.SessionMode.CIRCUIT : P25Message.SessionMode.PACKET; } public String getSystemID() diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/UnitToUnitVoiceChannelGrantExtended.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/UnitToUnitVoiceChannelGrantExtended.java new file mode 100644 index 00000000..81d30f74 --- /dev/null +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/UnitToUnitVoiceChannelGrantExtended.java @@ -0,0 +1,25 @@ +package io.github.dsheirer.module.decode.p25.message.pdu.osp.voice; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.pdu.UnitToUnitChannelGrantExtended; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class UnitToUnitVoiceChannelGrantExtended + extends UnitToUnitChannelGrantExtended + implements IdentifierReceiver +{ + public UnitToUnitVoiceChannelGrantExtended( BinaryMessage message, + DataUnitID duid, AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.UNIT_TO_UNIT_VOICE_CHANNEL_GRANT.getDescription(); + } +} diff --git a/src/module/decode/p25/message/pdu/osp/voice/UnitToUnitVoiceChannelGrantUpdateExtended.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/UnitToUnitVoiceChannelGrantUpdateExtended.java similarity index 92% rename from src/module/decode/p25/message/pdu/osp/voice/UnitToUnitVoiceChannelGrantUpdateExtended.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/UnitToUnitVoiceChannelGrantUpdateExtended.java index 322cb003..d981c610 100644 --- a/src/module/decode/p25/message/pdu/osp/voice/UnitToUnitVoiceChannelGrantUpdateExtended.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/UnitToUnitVoiceChannelGrantUpdateExtended.java @@ -16,16 +16,16 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.pdu.osp.voice; +package io.github.dsheirer.module.decode.p25.message.pdu.osp.voice; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRCP25; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.pdu.PDUMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRCP25; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; public class UnitToUnitVoiceChannelGrantUpdateExtended extends PDUMessage implements IdentifierReceiver { diff --git a/src/module/decode/p25/message/tdu/TDUMessage.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/TDUMessage.java similarity index 83% rename from src/module/decode/p25/message/tdu/TDUMessage.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/TDUMessage.java index 85a533ac..9bc63985 100644 --- a/src/module/decode/p25/message/tdu/TDUMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/TDUMessage.java @@ -16,13 +16,13 @@ * along with this program. If not, see ******************************************************************************/ -package module.decode.p25.message.tdu; +package io.github.dsheirer.module.decode.p25.message.tdu; -import module.decode.p25.message.P25Message; -import module.decode.p25.reference.DataUnitID; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRC; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRC; +import io.github.dsheirer.module.decode.p25.message.P25Message; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; public class TDUMessage extends P25Message { diff --git a/src/module/decode/p25/message/tdu/lc/AdjacentSiteStatusBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/AdjacentSiteStatusBroadcast.java similarity index 90% rename from src/module/decode/p25/message/tdu/lc/AdjacentSiteStatusBroadcast.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/AdjacentSiteStatusBroadcast.java index 2259c9d6..45aee039 100644 --- a/src/module/decode/p25/message/tdu/lc/AdjacentSiteStatusBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/AdjacentSiteStatusBroadcast.java @@ -16,13 +16,13 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.tdu.lc; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; -import module.decode.p25.message.IAdjacentSite; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.tsbk.osp.control.SystemService; -import module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.message.IAdjacentSite; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SystemService; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class AdjacentSiteStatusBroadcast extends TDULinkControlMessage implements IdentifierReceiver, IAdjacentSite { diff --git a/src/module/decode/p25/message/tdu/lc/AdjacentSiteStatusBroadcastExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/AdjacentSiteStatusBroadcastExplicit.java similarity index 93% rename from src/module/decode/p25/message/tdu/lc/AdjacentSiteStatusBroadcastExplicit.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/AdjacentSiteStatusBroadcastExplicit.java index 5be95844..669d58d8 100644 --- a/src/module/decode/p25/message/tdu/lc/AdjacentSiteStatusBroadcastExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/AdjacentSiteStatusBroadcastExplicit.java @@ -16,12 +16,12 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.tdu.lc; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; -import module.decode.p25.message.IAdjacentSite; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.message.IAdjacentSite; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class AdjacentSiteStatusBroadcastExplicit extends TDULinkControlMessage implements IdentifierReceiver, IAdjacentSite { diff --git a/src/module/decode/p25/message/tdu/lc/CallAlert.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/CallAlert.java similarity index 88% rename from src/module/decode/p25/message/tdu/lc/CallAlert.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/CallAlert.java index 3455e455..60d288e6 100644 --- a/src/module/decode/p25/message/tdu/lc/CallAlert.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/CallAlert.java @@ -1,6 +1,6 @@ -package module.decode.p25.message.tdu.lc; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; -import module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class CallAlert extends TDULinkControlMessage { diff --git a/src/module/decode/p25/message/tdu/lc/CallTermination.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/CallTermination.java similarity index 84% rename from src/module/decode/p25/message/tdu/lc/CallTermination.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/CallTermination.java index f8d08b59..721af006 100644 --- a/src/module/decode/p25/message/tdu/lc/CallTermination.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/CallTermination.java @@ -1,6 +1,6 @@ -package module.decode.p25.message.tdu.lc; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; -import module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class CallTermination extends TDULinkControlMessage { diff --git a/src/module/decode/p25/message/tdu/lc/ChannelIdentifierUpdate.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/ChannelIdentifierUpdate.java similarity index 94% rename from src/module/decode/p25/message/tdu/lc/ChannelIdentifierUpdate.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/ChannelIdentifierUpdate.java index 63440320..647838d5 100644 --- a/src/module/decode/p25/message/tdu/lc/ChannelIdentifierUpdate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/ChannelIdentifierUpdate.java @@ -16,10 +16,10 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.tdu.lc; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class ChannelIdentifierUpdate extends TDULinkControlMessage implements IBandIdentifier { diff --git a/src/module/decode/p25/message/tdu/lc/ChannelIdentifierUpdateExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/ChannelIdentifierUpdateExplicit.java similarity index 94% rename from src/module/decode/p25/message/tdu/lc/ChannelIdentifierUpdateExplicit.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/ChannelIdentifierUpdateExplicit.java index a3be9821..7858ec13 100644 --- a/src/module/decode/p25/message/tdu/lc/ChannelIdentifierUpdateExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/ChannelIdentifierUpdateExplicit.java @@ -16,10 +16,10 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.tdu.lc; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class ChannelIdentifierUpdateExplicit extends TDULinkControlMessage implements IBandIdentifier { diff --git a/src/module/decode/p25/message/tdu/lc/ExtendedFunctionCommand.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/ExtendedFunctionCommand.java similarity index 90% rename from src/module/decode/p25/message/tdu/lc/ExtendedFunctionCommand.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/ExtendedFunctionCommand.java index 55226ec6..3d8dd601 100644 --- a/src/module/decode/p25/message/tdu/lc/ExtendedFunctionCommand.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/ExtendedFunctionCommand.java @@ -1,8 +1,7 @@ -package module.decode.p25.message.tdu.lc; - -import module.decode.p25.reference.ExtendedFunction; -import module.decode.p25.reference.LinkControlOpcode; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; +import io.github.dsheirer.module.decode.p25.reference.ExtendedFunction; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/tdu/lc/GroupAffiliationQuery.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/GroupAffiliationQuery.java similarity index 89% rename from src/module/decode/p25/message/tdu/lc/GroupAffiliationQuery.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/GroupAffiliationQuery.java index 9a28ea64..aafe1d3b 100644 --- a/src/module/decode/p25/message/tdu/lc/GroupAffiliationQuery.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/GroupAffiliationQuery.java @@ -1,7 +1,6 @@ -package module.decode.p25.message.tdu.lc; - -import module.decode.p25.reference.LinkControlOpcode; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/tdu/lc/GroupVoiceChannelUpdate.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/GroupVoiceChannelUpdate.java similarity index 94% rename from src/module/decode/p25/message/tdu/lc/GroupVoiceChannelUpdate.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/GroupVoiceChannelUpdate.java index 3aa54dfc..c350c3da 100644 --- a/src/module/decode/p25/message/tdu/lc/GroupVoiceChannelUpdate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/GroupVoiceChannelUpdate.java @@ -16,13 +16,11 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.tdu.lc; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.reference.LinkControlOpcode; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import java.util.Set; import java.util.TreeSet; diff --git a/src/module/decode/p25/message/tdu/lc/GroupVoiceChannelUpdateExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/GroupVoiceChannelUpdateExplicit.java similarity index 94% rename from src/module/decode/p25/message/tdu/lc/GroupVoiceChannelUpdateExplicit.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/GroupVoiceChannelUpdateExplicit.java index 72c35bcb..55a6fb8d 100644 --- a/src/module/decode/p25/message/tdu/lc/GroupVoiceChannelUpdateExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/GroupVoiceChannelUpdateExplicit.java @@ -16,11 +16,11 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.tdu.lc; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/tdu/lc/GroupVoiceChannelUser.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/GroupVoiceChannelUser.java similarity index 93% rename from src/module/decode/p25/message/tdu/lc/GroupVoiceChannelUser.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/GroupVoiceChannelUser.java index 3db30f4e..daa3ab0a 100644 --- a/src/module/decode/p25/message/tdu/lc/GroupVoiceChannelUser.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/GroupVoiceChannelUser.java @@ -1,7 +1,6 @@ -package module.decode.p25.message.tdu.lc; - -import module.decode.p25.reference.LinkControlOpcode; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/tdu/lc/MessageUpdate.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/MessageUpdate.java similarity index 91% rename from src/module/decode/p25/message/tdu/lc/MessageUpdate.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/MessageUpdate.java index d0130219..39bc6607 100644 --- a/src/module/decode/p25/message/tdu/lc/MessageUpdate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/MessageUpdate.java @@ -1,7 +1,6 @@ -package module.decode.p25.message.tdu.lc; - -import module.decode.p25.reference.LinkControlOpcode; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/tdu/lc/NetworkStatusBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/NetworkStatusBroadcast.java similarity index 91% rename from src/module/decode/p25/message/tdu/lc/NetworkStatusBroadcast.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/NetworkStatusBroadcast.java index db403f1c..1d7cf390 100644 --- a/src/module/decode/p25/message/tdu/lc/NetworkStatusBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/NetworkStatusBroadcast.java @@ -16,12 +16,12 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.tdu.lc; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.reference.LinkControlOpcode; -import module.decode.p25.reference.Service; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.reference.Service; public class NetworkStatusBroadcast extends TDULinkControlMessage implements IdentifierReceiver { diff --git a/src/module/decode/p25/message/tdu/lc/NetworkStatusBroadcastExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/NetworkStatusBroadcastExplicit.java similarity index 93% rename from src/module/decode/p25/message/tdu/lc/NetworkStatusBroadcastExplicit.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/NetworkStatusBroadcastExplicit.java index a88536ca..16b51973 100644 --- a/src/module/decode/p25/message/tdu/lc/NetworkStatusBroadcastExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/NetworkStatusBroadcastExplicit.java @@ -16,11 +16,11 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.tdu.lc; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class NetworkStatusBroadcastExplicit extends TDULinkControlMessage implements IdentifierReceiver { diff --git a/src/module/decode/p25/message/tdu/lc/ProtectionParameterBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/ProtectionParameterBroadcast.java similarity index 88% rename from src/module/decode/p25/message/tdu/lc/ProtectionParameterBroadcast.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/ProtectionParameterBroadcast.java index 61b58083..2343bf2b 100644 --- a/src/module/decode/p25/message/tdu/lc/ProtectionParameterBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/ProtectionParameterBroadcast.java @@ -1,8 +1,7 @@ -package module.decode.p25.message.tdu.lc; - -import module.decode.p25.reference.Encryption; -import module.decode.p25.reference.LinkControlOpcode; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; +import io.github.dsheirer.module.decode.p25.reference.Encryption; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/tdu/lc/RFSSStatusBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/RFSSStatusBroadcast.java similarity index 91% rename from src/module/decode/p25/message/tdu/lc/RFSSStatusBroadcast.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/RFSSStatusBroadcast.java index cc29771b..8e556b7d 100644 --- a/src/module/decode/p25/message/tdu/lc/RFSSStatusBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/RFSSStatusBroadcast.java @@ -16,12 +16,12 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.tdu.lc; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.tsbk.osp.control.SystemService; -import module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SystemService; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class RFSSStatusBroadcast extends TDULinkControlMessage implements IdentifierReceiver { diff --git a/src/module/decode/p25/message/tdu/lc/RFSSStatusBroadcastExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/RFSSStatusBroadcastExplicit.java similarity index 93% rename from src/module/decode/p25/message/tdu/lc/RFSSStatusBroadcastExplicit.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/RFSSStatusBroadcastExplicit.java index 0bec65c4..40fcdf77 100644 --- a/src/module/decode/p25/message/tdu/lc/RFSSStatusBroadcastExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/RFSSStatusBroadcastExplicit.java @@ -16,12 +16,12 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.tdu.lc; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.tsbk.osp.control.SystemService; -import module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SystemService; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/tdu/lc/SecondaryControlChannelBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/SecondaryControlChannelBroadcast.java similarity index 93% rename from src/module/decode/p25/message/tdu/lc/SecondaryControlChannelBroadcast.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/SecondaryControlChannelBroadcast.java index e1cf6342..988eb294 100644 --- a/src/module/decode/p25/message/tdu/lc/SecondaryControlChannelBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/SecondaryControlChannelBroadcast.java @@ -16,12 +16,12 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.tdu.lc; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.tsbk.osp.control.SystemService; -import module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SystemService; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class SecondaryControlChannelBroadcast extends TDULinkControlMessage implements IdentifierReceiver { diff --git a/src/module/decode/p25/message/tdu/lc/SecondaryControlChannelBroadcastExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/SecondaryControlChannelBroadcastExplicit.java similarity index 92% rename from src/module/decode/p25/message/tdu/lc/SecondaryControlChannelBroadcastExplicit.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/SecondaryControlChannelBroadcastExplicit.java index 8032794d..705880bf 100644 --- a/src/module/decode/p25/message/tdu/lc/SecondaryControlChannelBroadcastExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/SecondaryControlChannelBroadcastExplicit.java @@ -16,12 +16,12 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.tdu.lc; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.tsbk.osp.control.SystemService; -import module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SystemService; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class SecondaryControlChannelBroadcastExplicit extends TDULinkControlMessage implements IdentifierReceiver { diff --git a/src/module/decode/p25/message/tdu/lc/StatusQuery.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/StatusQuery.java similarity index 89% rename from src/module/decode/p25/message/tdu/lc/StatusQuery.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/StatusQuery.java index 22ffeb3e..0c4acefd 100644 --- a/src/module/decode/p25/message/tdu/lc/StatusQuery.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/StatusQuery.java @@ -1,7 +1,6 @@ -package module.decode.p25.message.tdu.lc; - -import module.decode.p25.reference.LinkControlOpcode; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/tdu/lc/StatusUpdate.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/StatusUpdate.java similarity index 92% rename from src/module/decode/p25/message/tdu/lc/StatusUpdate.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/StatusUpdate.java index 2f99d620..239aa5de 100644 --- a/src/module/decode/p25/message/tdu/lc/StatusUpdate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/StatusUpdate.java @@ -1,7 +1,6 @@ -package module.decode.p25.message.tdu.lc; - -import module.decode.p25.reference.LinkControlOpcode; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/tdu/lc/SystemServiceBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/SystemServiceBroadcast.java similarity index 88% rename from src/module/decode/p25/message/tdu/lc/SystemServiceBroadcast.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/SystemServiceBroadcast.java index 70188f08..31d781a3 100644 --- a/src/module/decode/p25/message/tdu/lc/SystemServiceBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/SystemServiceBroadcast.java @@ -1,13 +1,12 @@ -package module.decode.p25.message.tdu.lc; - -import java.util.List; - -import module.decode.p25.reference.LinkControlOpcode; -import module.decode.p25.reference.Service; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.reference.Service; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.List; + public class SystemServiceBroadcast extends TDULinkControlMessage { private final static Logger mLog = diff --git a/src/module/decode/p25/message/tdu/lc/TDULCMessageFactory.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/TDULCMessageFactory.java similarity index 96% rename from src/module/decode/p25/message/tdu/lc/TDULCMessageFactory.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/TDULCMessageFactory.java index 67801d93..8e40d0a1 100644 --- a/src/module/decode/p25/message/tdu/lc/TDULCMessageFactory.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/TDULCMessageFactory.java @@ -1,7 +1,6 @@ -package module.decode.p25.message.tdu.lc; - -import module.decode.p25.reference.Vendor; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; +import io.github.dsheirer.module.decode.p25.reference.Vendor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/tdu/lc/TDULinkControlMessage.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/TDULinkControlMessage.java similarity index 92% rename from src/module/decode/p25/message/tdu/lc/TDULinkControlMessage.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/TDULinkControlMessage.java index 35d8b979..1429e2d6 100644 --- a/src/module/decode/p25/message/tdu/lc/TDULinkControlMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/TDULinkControlMessage.java @@ -1,21 +1,19 @@ -package module.decode.p25.message.tdu.lc; - -import module.decode.p25.message.P25Message; -import module.decode.p25.message.tsbk.motorola.MotorolaOpcode; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.LinkControlOpcode; -import module.decode.p25.reference.Vendor; -import module.decode.p25.reference.VendorLinkControlOpcode; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRC; +import io.github.dsheirer.edac.Golay24; +import io.github.dsheirer.edac.ReedSolomon_63_47_17; +import io.github.dsheirer.module.decode.p25.message.P25Message; +import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.MotorolaOpcode; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.reference.Vendor; +import io.github.dsheirer.module.decode.p25.reference.VendorLinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRC; -import edac.Golay24; -import edac.ReedSolomon_63_47_17; - public class TDULinkControlMessage extends P25Message { public final static Logger mLog = LoggerFactory.getLogger( TDULinkControlMessage.class ); @@ -196,7 +194,7 @@ public class TDULinkControlMessage extends P25Message x += 24; } - /* Check the Reed-Solomon parity bits. The RS decoder expects the link + /* Check the Reed-Solomon parity bits. The RS decoder expects the link * control data and reed solomon parity hex codewords in reverse order. * The RS(24,12,13) code used by P25 removes the left-hand 47 data hex * words, so we replace them with zeros. */ diff --git a/src/module/decode/p25/message/tdu/lc/TelephoneInterconnectAnswerRequest.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/TelephoneInterconnectAnswerRequest.java similarity index 92% rename from src/module/decode/p25/message/tdu/lc/TelephoneInterconnectAnswerRequest.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/TelephoneInterconnectAnswerRequest.java index fd8f4c9f..503b1ed3 100644 --- a/src/module/decode/p25/message/tdu/lc/TelephoneInterconnectAnswerRequest.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/TelephoneInterconnectAnswerRequest.java @@ -1,14 +1,13 @@ -package module.decode.p25.message.tdu.lc; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; + +import io.github.dsheirer.module.decode.p25.reference.Digit; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.List; -import module.decode.p25.reference.Digit; -import module.decode.p25.reference.LinkControlOpcode; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class TelephoneInterconnectAnswerRequest extends TDULinkControlMessage { private final static Logger mLog = LoggerFactory.getLogger( TelephoneInterconnectAnswerRequest.class ); diff --git a/src/module/decode/p25/message/tdu/lc/TelephoneInterconnectVoiceChannelUser.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/TelephoneInterconnectVoiceChannelUser.java similarity index 94% rename from src/module/decode/p25/message/tdu/lc/TelephoneInterconnectVoiceChannelUser.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/TelephoneInterconnectVoiceChannelUser.java index d10b347e..b969b3cc 100644 --- a/src/module/decode/p25/message/tdu/lc/TelephoneInterconnectVoiceChannelUser.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/TelephoneInterconnectVoiceChannelUser.java @@ -1,7 +1,6 @@ -package module.decode.p25.message.tdu.lc; - -import module.decode.p25.reference.LinkControlOpcode; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/tdu/lc/UnitAuthenticationCommand.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/UnitAuthenticationCommand.java similarity index 91% rename from src/module/decode/p25/message/tdu/lc/UnitAuthenticationCommand.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/UnitAuthenticationCommand.java index 7cdc9d59..6a458d26 100644 --- a/src/module/decode/p25/message/tdu/lc/UnitAuthenticationCommand.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/UnitAuthenticationCommand.java @@ -1,7 +1,6 @@ -package module.decode.p25.message.tdu.lc; - -import module.decode.p25.reference.LinkControlOpcode; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -13,7 +12,7 @@ public class UnitAuthenticationCommand extends TDULinkControlMessage 95,96,97,98,99,112,113,114,115 }; public static final int[] SYSTEM_ID = { 116,117,118,119,120,121,122,123, 136,137,138,139 }; - /* ICD says this is a source id, but this is a command messages, so this + /* ICD says this is a source id, but this is a command messages, so this * must be a target id */ public static final int[] TARGET_ID = { 140,141,142,143,144,145,146,147, 160,161,162,163,164,165,166,167,168,169,170,171,184,185,186,187 }; diff --git a/src/module/decode/p25/message/tdu/lc/UnitRegistrationCommand.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/UnitRegistrationCommand.java similarity index 92% rename from src/module/decode/p25/message/tdu/lc/UnitRegistrationCommand.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/UnitRegistrationCommand.java index d66360d6..145f237d 100644 --- a/src/module/decode/p25/message/tdu/lc/UnitRegistrationCommand.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/UnitRegistrationCommand.java @@ -1,7 +1,6 @@ -package module.decode.p25.message.tdu.lc; - -import module.decode.p25.reference.LinkControlOpcode; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/tdu/lc/UnitToUnitAnswerRequest.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/UnitToUnitAnswerRequest.java similarity index 93% rename from src/module/decode/p25/message/tdu/lc/UnitToUnitAnswerRequest.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/UnitToUnitAnswerRequest.java index 90bacc50..e6cd06d7 100644 --- a/src/module/decode/p25/message/tdu/lc/UnitToUnitAnswerRequest.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/UnitToUnitAnswerRequest.java @@ -1,7 +1,6 @@ -package module.decode.p25.message.tdu.lc; - -import module.decode.p25.reference.LinkControlOpcode; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/tdu/lc/UnitToUnitVoiceChannelUser.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/UnitToUnitVoiceChannelUser.java similarity index 93% rename from src/module/decode/p25/message/tdu/lc/UnitToUnitVoiceChannelUser.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/UnitToUnitVoiceChannelUser.java index 47157a58..7789e094 100644 --- a/src/module/decode/p25/message/tdu/lc/UnitToUnitVoiceChannelUser.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/UnitToUnitVoiceChannelUser.java @@ -1,7 +1,6 @@ -package module.decode.p25.message.tdu.lc; - -import module.decode.p25.reference.LinkControlOpcode; +package io.github.dsheirer.module.decode.p25.message.tdu.lc; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/module/decode/p25/message/tsbk/ChannelGrant.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/ChannelGrant.java similarity index 88% rename from src/module/decode/p25/message/tsbk/ChannelGrant.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/ChannelGrant.java index fa4893c7..9fad0b82 100644 --- a/src/module/decode/p25/message/tsbk/ChannelGrant.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/ChannelGrant.java @@ -1,110 +1,110 @@ -/******************************************************************************* - * 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 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 - * - ******************************************************************************/ -package module.decode.p25.message.tsbk; - -import alias.AliasList; -import bits.BinaryMessage; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.reference.DataUnitID; - -public abstract class ChannelGrant extends ServiceMessage implements IdentifierReceiver -{ - public static final int[] PRIORITY = {85, 86, 87}; - public static final int[] CHANNEL_IDENTIFIER = {88, 89, 90, 91}; - public static final int[] CHANNEL_NUMBER = {92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103}; - - private IBandIdentifier mIdentifierUpdate; - - public ChannelGrant(BinaryMessage message, DataUnitID duid, AliasList aliasList) - { - super(message, duid, aliasList); - } - - /** - * Indicates if this channel grant is for a TDMA channel - */ - public boolean isTDMAChannel() - { - if(mIdentifierUpdate != null) - { - return mIdentifierUpdate.isTDMA(); - } - - return false; - } - - /** - * 1 = Lowest, 4 = Default, 7 = Highest - */ - public int getPriority() - { - return mMessage.getInt(PRIORITY); - } - - public int getChannelIdentifier() - { - return mMessage.getInt(CHANNEL_IDENTIFIER); - } - - public int getChannelNumber() - { - return mMessage.getInt(CHANNEL_NUMBER); - } - - public String getChannel() - { - return getChannelIdentifier() + "-" + getChannelNumber(); - } - - @Override - public void setIdentifierMessage(int identifier, IBandIdentifier message) - { - mIdentifierUpdate = message; - } - - @Override - public int[] getIdentifiers() - { - int[] identifiers = new int[1]; - identifiers[0] = getChannelIdentifier(); - - return identifiers; - } - - public long getDownlinkFrequency() - { - if(mIdentifierUpdate != null) - { - return mIdentifierUpdate.getDownlinkFrequency(getChannelNumber()); - } - - return 0; - } - - public long getUplinkFrequency() - { - if(mIdentifierUpdate != null) - { - return mIdentifierUpdate.getUplinkFrequency(getChannelNumber()); - } - - return 0; - } -} +/******************************************************************************* + * 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 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 + * + ******************************************************************************/ +package io.github.dsheirer.module.decode.p25.message.tsbk; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; + +public abstract class ChannelGrant extends ServiceMessage implements IdentifierReceiver +{ + public static final int[] PRIORITY = {85, 86, 87}; + public static final int[] CHANNEL_IDENTIFIER = {88, 89, 90, 91}; + public static final int[] CHANNEL_NUMBER = {92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103}; + + private IBandIdentifier mIdentifierUpdate; + + public ChannelGrant(BinaryMessage message, DataUnitID duid, AliasList aliasList) + { + super(message, duid, aliasList); + } + + /** + * Indicates if this channel grant is for a TDMA channel + */ + public boolean isTDMAChannel() + { + if(mIdentifierUpdate != null) + { + return mIdentifierUpdate.isTDMA(); + } + + return false; + } + + /** + * 1 = Lowest, 4 = Default, 7 = Highest + */ + public int getPriority() + { + return mMessage.getInt(PRIORITY); + } + + public int getChannelIdentifier() + { + return mMessage.getInt(CHANNEL_IDENTIFIER); + } + + public int getChannelNumber() + { + return mMessage.getInt(CHANNEL_NUMBER); + } + + public String getChannel() + { + return getChannelIdentifier() + "-" + getChannelNumber(); + } + + @Override + public void setIdentifierMessage(int identifier, IBandIdentifier message) + { + mIdentifierUpdate = message; + } + + @Override + public int[] getIdentifiers() + { + int[] identifiers = new int[1]; + identifiers[0] = getChannelIdentifier(); + + return identifiers; + } + + public long getDownlinkFrequency() + { + if(mIdentifierUpdate != null) + { + return mIdentifierUpdate.getDownlinkFrequency(getChannelNumber()); + } + + return 0; + } + + public long getUplinkFrequency() + { + if(mIdentifierUpdate != null) + { + return mIdentifierUpdate.getUplinkFrequency(getChannelNumber()); + } + + return 0; + } +} diff --git a/src/module/decode/p25/message/tsbk/GroupChannelGrant.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/GroupChannelGrant.java similarity index 89% rename from src/module/decode/p25/message/tsbk/GroupChannelGrant.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/GroupChannelGrant.java index 446f3631..6f1b3d48 100644 --- a/src/module/decode/p25/message/tsbk/GroupChannelGrant.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/GroupChannelGrant.java @@ -1,93 +1,93 @@ -package module.decode.p25.message.tsbk; - -import module.decode.p25.reference.DataUnitID; -import alias.Alias; -import alias.AliasList; -import bits.BinaryMessage; - -public abstract class GroupChannelGrant extends ChannelGrant -{ - public static final int[] GROUP_ADDRESS = { 104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119 }; - - public static final int[] SOURCE_ADDRESS = { 120,121,122,123,124,125,126, - 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; - - public GroupChannelGrant( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - public String getGroupAddress() - { - return mMessage.getHex( GROUP_ADDRESS, 4 ); - } - - public String getSourceAddress() - { - return mMessage.getHex( SOURCE_ADDRESS, 6 ); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - - if( isEmergency() ) - { - sb.append( " EMERGENCY" ); - } - - sb.append( " SOURCE UNIT:" ); - sb.append( getSourceAddress() ); - - sb.append( " GROUP:" ); - sb.append( getGroupAddress() ); - - sb.append( " CHAN:" ); - sb.append( getChannelIdentifier() + "-" + getChannelNumber() ); - - sb.append( " DN:" + getDownlinkFrequency() ); - - sb.append( " UP:" + getUplinkFrequency() ); - - return sb.toString(); - } - - @Override - public String getFromID() - { - return getSourceAddress(); - } - - @Override - public Alias getFromIDAlias() - { - if( mAliasList != null ) - { - return mAliasList.getTalkgroupAlias( getFromID() ); - } - - return null; - } - - @Override - public String getToID() - { - return getGroupAddress(); - } - - @Override - public Alias getToIDAlias() - { - if( mAliasList != null ) - { - return mAliasList.getTalkgroupAlias( getGroupAddress() ); - } - - return null; - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk; + +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; + +public abstract class GroupChannelGrant extends ChannelGrant +{ + public static final int[] GROUP_ADDRESS = { 104,105,106,107,108,109,110,111, + 112,113,114,115,116,117,118,119 }; + + public static final int[] SOURCE_ADDRESS = { 120,121,122,123,124,125,126, + 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; + + public GroupChannelGrant( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + public String getGroupAddress() + { + return mMessage.getHex( GROUP_ADDRESS, 4 ); + } + + public String getSourceAddress() + { + return mMessage.getHex( SOURCE_ADDRESS, 6 ); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + + if( isEmergency() ) + { + sb.append( " EMERGENCY" ); + } + + sb.append( " SOURCE UNIT:" ); + sb.append( getSourceAddress() ); + + sb.append( " GROUP:" ); + sb.append( getGroupAddress() ); + + sb.append( " CHAN:" ); + sb.append( getChannelIdentifier() + "-" + getChannelNumber() ); + + sb.append( " DN:" + getDownlinkFrequency() ); + + sb.append( " UP:" + getUplinkFrequency() ); + + return sb.toString(); + } + + @Override + public String getFromID() + { + return getSourceAddress(); + } + + @Override + public Alias getFromIDAlias() + { + if( mAliasList != null ) + { + return mAliasList.getTalkgroupAlias( getFromID() ); + } + + return null; + } + + @Override + public String getToID() + { + return getGroupAddress(); + } + + @Override + public Alias getToIDAlias() + { + if( mAliasList != null ) + { + return mAliasList.getTalkgroupAlias( getGroupAddress() ); + } + + return null; + } +} diff --git a/src/module/decode/p25/message/tsbk/GroupChannelGrantExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/GroupChannelGrantExplicit.java similarity index 92% rename from src/module/decode/p25/message/tsbk/GroupChannelGrantExplicit.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/GroupChannelGrantExplicit.java index 5a656706..bf18e3bc 100644 --- a/src/module/decode/p25/message/tsbk/GroupChannelGrantExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/GroupChannelGrantExplicit.java @@ -1,155 +1,155 @@ -/******************************************************************************* - * 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 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 - * - ******************************************************************************/ -package module.decode.p25.message.tsbk; - -import alias.AliasList; -import bits.BinaryMessage; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.reference.DataUnitID; - -public abstract class GroupChannelGrantExplicit extends ChannelGrant -{ - public static final int[] TRANSMIT_IDENTIFIER = {96, 97, 98, 99}; - public static final int[] TRANSMIT_NUMBER = {100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111}; - public static final int[] RECEIVE_IDENTIFIER = {112, 113, 114, 115}; - public static final int[] RECEIVE_NUMBER = {116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127}; - public static final int[] GROUP_ADDRESS = {128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143}; - - private IBandIdentifier mTransmitIdentifierUpdate; - private IBandIdentifier mReceiveIdentifierUpdate; - - public GroupChannelGrantExplicit(BinaryMessage message, DataUnitID duid, AliasList aliasList) - { - super(message, duid, aliasList); - } - - @Override - public boolean isTDMAChannel() - { - if(mTransmitIdentifierUpdate != null) - { - return mTransmitIdentifierUpdate.isTDMA(); - } - - return false; - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append(getMessageStub()); - - if(isEmergency()) - { - sb.append(" EMERGENCY"); - } - - sb.append(" XMIT:"); - sb.append(getTransmitChannelIdentifier() + "/" + getTransmitChannelNumber()); - - sb.append(" RCV:"); - sb.append(getReceiveChannelIdentifier() + "/" + getReceiveChannelNumber()); - - sb.append(" GRP:"); - sb.append(getGroupAddress()); - - return sb.toString(); - } - - public int getTransmitChannelIdentifier() - { - return mMessage.getInt(TRANSMIT_IDENTIFIER); - } - - public int getTransmitChannelNumber() - { - return mMessage.getInt(TRANSMIT_NUMBER); - } - - public String getTransmitChannel() - { - return getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber(); - } - - public int getReceiveChannelIdentifier() - { - return mMessage.getInt(RECEIVE_IDENTIFIER); - } - - public int getReceiveChannelNumber() - { - return mMessage.getInt(RECEIVE_NUMBER); - } - - public String getReceiveChannel() - { - return getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber(); - } - - public String getGroupAddress() - { - return mMessage.getHex(GROUP_ADDRESS, 4); - } - - @Override - public void setIdentifierMessage(int identifier, IBandIdentifier message) - { - if(identifier == getTransmitChannelIdentifier()) - { - mTransmitIdentifierUpdate = message; - } - - if(identifier == getReceiveChannelIdentifier()) - { - mReceiveIdentifierUpdate = message; - } - } - - @Override - public int[] getIdentifiers() - { - int[] identifiers = new int[2]; - identifiers[0] = getTransmitChannelIdentifier(); - identifiers[1] = getReceiveChannelIdentifier(); - - return identifiers; - } - - public long getDownlinkFrequency() - { - if(mTransmitIdentifierUpdate != null) - { - return mTransmitIdentifierUpdate.getDownlinkFrequency(getTransmitChannelNumber()); - } - - return 0; - } - - public long getUplinkFrequency() - { - if(mReceiveIdentifierUpdate != null) - { - return mReceiveIdentifierUpdate.getUplinkFrequency(getReceiveChannelNumber()); - } - - return 0; - } -} +/******************************************************************************* + * 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 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 + * + ******************************************************************************/ +package io.github.dsheirer.module.decode.p25.message.tsbk; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; + +public abstract class GroupChannelGrantExplicit extends ChannelGrant +{ + public static final int[] TRANSMIT_IDENTIFIER = {96, 97, 98, 99}; + public static final int[] TRANSMIT_NUMBER = {100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111}; + public static final int[] RECEIVE_IDENTIFIER = {112, 113, 114, 115}; + public static final int[] RECEIVE_NUMBER = {116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127}; + public static final int[] GROUP_ADDRESS = {128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143}; + + private IBandIdentifier mTransmitIdentifierUpdate; + private IBandIdentifier mReceiveIdentifierUpdate; + + public GroupChannelGrantExplicit(BinaryMessage message, DataUnitID duid, AliasList aliasList) + { + super(message, duid, aliasList); + } + + @Override + public boolean isTDMAChannel() + { + if(mTransmitIdentifierUpdate != null) + { + return mTransmitIdentifierUpdate.isTDMA(); + } + + return false; + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append(getMessageStub()); + + if(isEmergency()) + { + sb.append(" EMERGENCY"); + } + + sb.append(" XMIT:"); + sb.append(getTransmitChannelIdentifier() + "/" + getTransmitChannelNumber()); + + sb.append(" RCV:"); + sb.append(getReceiveChannelIdentifier() + "/" + getReceiveChannelNumber()); + + sb.append(" GRP:"); + sb.append(getGroupAddress()); + + return sb.toString(); + } + + public int getTransmitChannelIdentifier() + { + return mMessage.getInt(TRANSMIT_IDENTIFIER); + } + + public int getTransmitChannelNumber() + { + return mMessage.getInt(TRANSMIT_NUMBER); + } + + public String getTransmitChannel() + { + return getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber(); + } + + public int getReceiveChannelIdentifier() + { + return mMessage.getInt(RECEIVE_IDENTIFIER); + } + + public int getReceiveChannelNumber() + { + return mMessage.getInt(RECEIVE_NUMBER); + } + + public String getReceiveChannel() + { + return getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber(); + } + + public String getGroupAddress() + { + return mMessage.getHex(GROUP_ADDRESS, 4); + } + + @Override + public void setIdentifierMessage(int identifier, IBandIdentifier message) + { + if(identifier == getTransmitChannelIdentifier()) + { + mTransmitIdentifierUpdate = message; + } + + if(identifier == getReceiveChannelIdentifier()) + { + mReceiveIdentifierUpdate = message; + } + } + + @Override + public int[] getIdentifiers() + { + int[] identifiers = new int[2]; + identifiers[0] = getTransmitChannelIdentifier(); + identifiers[1] = getReceiveChannelIdentifier(); + + return identifiers; + } + + public long getDownlinkFrequency() + { + if(mTransmitIdentifierUpdate != null) + { + return mTransmitIdentifierUpdate.getDownlinkFrequency(getTransmitChannelNumber()); + } + + return 0; + } + + public long getUplinkFrequency() + { + if(mReceiveIdentifierUpdate != null) + { + return mReceiveIdentifierUpdate.getUplinkFrequency(getReceiveChannelNumber()); + } + + return 0; + } +} diff --git a/src/module/decode/p25/message/tsbk/GroupMultiChannelGrant.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/GroupMultiChannelGrant.java similarity index 92% rename from src/module/decode/p25/message/tsbk/GroupMultiChannelGrant.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/GroupMultiChannelGrant.java index 8c2bf284..4fd3d263 100644 --- a/src/module/decode/p25/message/tsbk/GroupMultiChannelGrant.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/GroupMultiChannelGrant.java @@ -1,220 +1,220 @@ -/******************************************************************************* - * 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 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 - * - ******************************************************************************/ -package module.decode.p25.message.tsbk; - -import alias.AliasList; -import bits.BinaryMessage; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.reference.DataUnitID; - -public abstract class GroupMultiChannelGrant extends ChannelGrant implements IdentifierReceiver -{ - public static final int[] CHANNEL_IDENTIFIER_1 = {80, 81, 82, 83}; - public static final int[] CHANNEL_NUMBER_1 = {84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95}; - public static final int[] GROUP_ADDRESS_1 = {96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111}; - public static final int[] CHANNEL_IDENTIFIER_2 = {112, 113, 114, 115}; - public static final int[] CHANNEL_NUMBER_2 = {116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127}; - public static final int[] GROUP_ADDRESS_2 = {128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143}; - - private IBandIdentifier mIdentifierUpdate1; - private IBandIdentifier mIdentifierUpdate2; - - public GroupMultiChannelGrant(BinaryMessage message, DataUnitID duid, AliasList aliasList) - { - super(message, duid, aliasList); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append(getMessageStub()); - - sb.append(" CHAN1:"); - sb.append(getChannelIdentifier1() + "/" + getChannelNumber1()); - - sb.append(" GRP1:"); - sb.append(getGroupAddress1()); - - if(hasChannelNumber2()) - { - sb.append(" CHAN2:"); - sb.append(getChannelIdentifier2() + "/" + getChannelNumber2()); - - sb.append(" GRP2:"); - sb.append(getGroupAddress2()); - } - - return sb.toString(); - } - - public int getChannelIdentifier1() - { - return mMessage.getInt(CHANNEL_IDENTIFIER_1); - } - - public int getChannelNumber1() - { - return mMessage.getInt(CHANNEL_NUMBER_1); - } - - public String getChannel1() - { - return getChannelIdentifier1() + "-" + getChannelNumber1(); - } - - public String getGroupAddress1() - { - return mMessage.getHex(GROUP_ADDRESS_1, 4); - } - - public int getChannelIdentifier2() - { - return mMessage.getInt(CHANNEL_IDENTIFIER_2); - } - - public int getChannelNumber2() - { - return mMessage.getInt(CHANNEL_NUMBER_2); - } - - public String getChannel2() - { - return getChannelIdentifier2() + "-" + getChannelNumber2(); - } - - public String getGroupAddress2() - { - return mMessage.getHex(GROUP_ADDRESS_2, 4); - } - - public boolean hasChannelNumber2() - { - return mMessage.getInt(CHANNEL_NUMBER_2) != - mMessage.getInt(CHANNEL_NUMBER_1); - } - - @Override - public String getFromID() - { - return getGroupAddress1(); - } - - @Override - public String getToID() - { - return getGroupAddress2(); - } - - @Override - public void setIdentifierMessage(int identifier, IBandIdentifier message) - { - if(identifier == getChannelIdentifier1()) - { - mIdentifierUpdate1 = message; - } - - if(hasChannelNumber2() && identifier == getChannelIdentifier2()) - { - mIdentifierUpdate2 = message; - } - } - - @Override - public int[] getIdentifiers() - { - int[] identifiers; - - if(hasChannelNumber2()) - { - identifiers = new int[2]; - identifiers[0] = getChannelIdentifier1(); - identifiers[1] = getChannelIdentifier2(); - } - else - { - identifiers = new int[1]; - identifiers[0] = getChannelIdentifier1(); - } - - return identifiers; - } - - public long getDownlinkFrequency1() - { - if(mIdentifierUpdate1 != null) - { - return mIdentifierUpdate1.getDownlinkFrequency(getChannelNumber1()); - } - - return 0; - } - - public boolean isTDMAChannel1() - { - if(mIdentifierUpdate1 != null) - { - return mIdentifierUpdate1.isTDMA(); - } - - return false; - } - - public long getUplinkFrequency1() - { - if(mIdentifierUpdate1 != null) - { - return mIdentifierUpdate1.getUplinkFrequency(getChannelNumber1()); - } - - return 0; - } - - public long getDownlinkFrequency2() - { - if(mIdentifierUpdate2 != null) - { - return mIdentifierUpdate2.getDownlinkFrequency(getChannelNumber2()); - } - - return 0; - } - - public boolean isTDMAChannel2() - { - if(mIdentifierUpdate2 != null) - { - return mIdentifierUpdate2.isTDMA(); - } - - return false; - } - - public long getUplinkFrequency2() - { - if(mIdentifierUpdate2 != null) - { - return mIdentifierUpdate2.getUplinkFrequency(getChannelNumber2()); - } - - return 0; - } - -} +/******************************************************************************* + * 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 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 + * + ******************************************************************************/ +package io.github.dsheirer.module.decode.p25.message.tsbk; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; + +public abstract class GroupMultiChannelGrant extends ChannelGrant implements IdentifierReceiver +{ + public static final int[] CHANNEL_IDENTIFIER_1 = {80, 81, 82, 83}; + public static final int[] CHANNEL_NUMBER_1 = {84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95}; + public static final int[] GROUP_ADDRESS_1 = {96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111}; + public static final int[] CHANNEL_IDENTIFIER_2 = {112, 113, 114, 115}; + public static final int[] CHANNEL_NUMBER_2 = {116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127}; + public static final int[] GROUP_ADDRESS_2 = {128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143}; + + private IBandIdentifier mIdentifierUpdate1; + private IBandIdentifier mIdentifierUpdate2; + + public GroupMultiChannelGrant(BinaryMessage message, DataUnitID duid, AliasList aliasList) + { + super(message, duid, aliasList); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append(getMessageStub()); + + sb.append(" CHAN1:"); + sb.append(getChannelIdentifier1() + "/" + getChannelNumber1()); + + sb.append(" GRP1:"); + sb.append(getGroupAddress1()); + + if(hasChannelNumber2()) + { + sb.append(" CHAN2:"); + sb.append(getChannelIdentifier2() + "/" + getChannelNumber2()); + + sb.append(" GRP2:"); + sb.append(getGroupAddress2()); + } + + return sb.toString(); + } + + public int getChannelIdentifier1() + { + return mMessage.getInt(CHANNEL_IDENTIFIER_1); + } + + public int getChannelNumber1() + { + return mMessage.getInt(CHANNEL_NUMBER_1); + } + + public String getChannel1() + { + return getChannelIdentifier1() + "-" + getChannelNumber1(); + } + + public String getGroupAddress1() + { + return mMessage.getHex(GROUP_ADDRESS_1, 4); + } + + public int getChannelIdentifier2() + { + return mMessage.getInt(CHANNEL_IDENTIFIER_2); + } + + public int getChannelNumber2() + { + return mMessage.getInt(CHANNEL_NUMBER_2); + } + + public String getChannel2() + { + return getChannelIdentifier2() + "-" + getChannelNumber2(); + } + + public String getGroupAddress2() + { + return mMessage.getHex(GROUP_ADDRESS_2, 4); + } + + public boolean hasChannelNumber2() + { + return mMessage.getInt(CHANNEL_NUMBER_2) != + mMessage.getInt(CHANNEL_NUMBER_1); + } + + @Override + public String getFromID() + { + return getGroupAddress1(); + } + + @Override + public String getToID() + { + return getGroupAddress2(); + } + + @Override + public void setIdentifierMessage(int identifier, IBandIdentifier message) + { + if(identifier == getChannelIdentifier1()) + { + mIdentifierUpdate1 = message; + } + + if(hasChannelNumber2() && identifier == getChannelIdentifier2()) + { + mIdentifierUpdate2 = message; + } + } + + @Override + public int[] getIdentifiers() + { + int[] identifiers; + + if(hasChannelNumber2()) + { + identifiers = new int[2]; + identifiers[0] = getChannelIdentifier1(); + identifiers[1] = getChannelIdentifier2(); + } + else + { + identifiers = new int[1]; + identifiers[0] = getChannelIdentifier1(); + } + + return identifiers; + } + + public long getDownlinkFrequency1() + { + if(mIdentifierUpdate1 != null) + { + return mIdentifierUpdate1.getDownlinkFrequency(getChannelNumber1()); + } + + return 0; + } + + public boolean isTDMAChannel1() + { + if(mIdentifierUpdate1 != null) + { + return mIdentifierUpdate1.isTDMA(); + } + + return false; + } + + public long getUplinkFrequency1() + { + if(mIdentifierUpdate1 != null) + { + return mIdentifierUpdate1.getUplinkFrequency(getChannelNumber1()); + } + + return 0; + } + + public long getDownlinkFrequency2() + { + if(mIdentifierUpdate2 != null) + { + return mIdentifierUpdate2.getDownlinkFrequency(getChannelNumber2()); + } + + return 0; + } + + public boolean isTDMAChannel2() + { + if(mIdentifierUpdate2 != null) + { + return mIdentifierUpdate2.isTDMA(); + } + + return false; + } + + public long getUplinkFrequency2() + { + if(mIdentifierUpdate2 != null) + { + return mIdentifierUpdate2.getUplinkFrequency(getChannelNumber2()); + } + + return 0; + } + +} diff --git a/src/module/decode/p25/message/tsbk/ServiceMessage.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/ServiceMessage.java similarity index 57% rename from src/module/decode/p25/message/tsbk/ServiceMessage.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/ServiceMessage.java index 78d200ca..9e46a463 100644 --- a/src/module/decode/p25/message/tsbk/ServiceMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/ServiceMessage.java @@ -1,42 +1,43 @@ -package module.decode.p25.message.tsbk; - -import module.decode.p25.reference.DataUnitID; -import alias.AliasList; -import bits.BinaryMessage; - -public abstract class ServiceMessage extends TSBKMessage -{ - /* Service Options */ - public static final int EMERGENCY_FLAG = 80; - public static final int ENCRYPTED_CHANNEL_FLAG = 81; - public static final int DUPLEX_MODE = 82; - public static final int SESSION_MODE = 83; - - public ServiceMessage( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - public boolean isEmergency() - { - return mMessage.get( EMERGENCY_FLAG ); - } - - public boolean isEncryptedChannel() - { - return mMessage.get( ENCRYPTED_CHANNEL_FLAG ); - } - - public DuplexMode getDuplexMode() - { - return mMessage.get( DUPLEX_MODE ) ? DuplexMode.FULL : DuplexMode.HALF; - } - - public SessionMode getSessionMode() - { - return mMessage.get( SESSION_MODE ) ? - SessionMode.CIRCUIT : SessionMode.PACKET; - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.P25Message; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; + +public abstract class ServiceMessage extends TSBKMessage +{ + /* Service Options */ + public static final int EMERGENCY_FLAG = 80; + public static final int ENCRYPTED_CHANNEL_FLAG = 81; + public static final int DUPLEX_MODE = 82; + public static final int SESSION_MODE = 83; + + public ServiceMessage( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + public boolean isEmergency() + { + return mMessage.get( EMERGENCY_FLAG ); + } + + public boolean isEncryptedChannel() + { + return mMessage.get( ENCRYPTED_CHANNEL_FLAG ); + } + + public P25Message.DuplexMode getDuplexMode() + { + return mMessage.get( DUPLEX_MODE ) ? P25Message.DuplexMode.FULL : P25Message.DuplexMode.HALF; + } + + public P25Message.SessionMode getSessionMode() + { + return mMessage.get( SESSION_MODE ) ? + P25Message.SessionMode.CIRCUIT : P25Message.SessionMode.PACKET; + } +} diff --git a/src/module/decode/p25/message/tsbk/TSBKMessage.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/TSBKMessage.java similarity index 85% rename from src/module/decode/p25/message/tsbk/TSBKMessage.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/TSBKMessage.java index cbbec09e..6753a1e0 100644 --- a/src/module/decode/p25/message/tsbk/TSBKMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/TSBKMessage.java @@ -1,14 +1,14 @@ -package module.decode.p25.message.tsbk; +package io.github.dsheirer.module.decode.p25.message.tsbk; -import module.decode.p25.message.P25Message; -import module.decode.p25.message.tsbk.motorola.MotorolaOpcode; -import module.decode.p25.message.tsbk.vendor.VendorOpcode; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import module.decode.p25.reference.Vendor; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRC; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRC; +import io.github.dsheirer.module.decode.p25.message.P25Message; +import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.MotorolaOpcode; +import io.github.dsheirer.module.decode.p25.message.tsbk.vendor.VendorOpcode; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; +import io.github.dsheirer.module.decode.p25.reference.Vendor; public class TSBKMessage extends P25Message { diff --git a/src/module/decode/p25/message/tsbk/TSBKMessageFactory.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/TSBKMessageFactory.java similarity index 58% rename from src/module/decode/p25/message/tsbk/TSBKMessageFactory.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/TSBKMessageFactory.java index 5db07165..f5b225aa 100644 --- a/src/module/decode/p25/message/tsbk/TSBKMessageFactory.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/TSBKMessageFactory.java @@ -1,64 +1,64 @@ -package module.decode.p25.message.tsbk; +package io.github.dsheirer.module.decode.p25.message.tsbk; -import alias.AliasList; -import bits.BinaryMessage; -import module.decode.p25.message.tsbk.motorola.ControlChannelBaseStationIdentification; -import module.decode.p25.message.tsbk.motorola.MotorolaOpcode; -import module.decode.p25.message.tsbk.motorola.MotorolaTSBKMessage; -import module.decode.p25.message.tsbk.motorola.PatchGroupAdd; -import module.decode.p25.message.tsbk.motorola.PatchGroupDelete; -import module.decode.p25.message.tsbk.motorola.PatchGroupVoiceChannelGrant; -import module.decode.p25.message.tsbk.motorola.PatchGroupVoiceChannelGrantUpdate; -import module.decode.p25.message.tsbk.motorola.PlannedControlChannnelShutdown; -import module.decode.p25.message.tsbk.motorola.SystemLoading; -import module.decode.p25.message.tsbk.motorola.TrafficChannelBaseStationIdentification; -import module.decode.p25.message.tsbk.osp.control.AcknowledgeResponse; -import module.decode.p25.message.tsbk.osp.control.AdjacentStatusBroadcast; -import module.decode.p25.message.tsbk.osp.control.AuthenticationCommand; -import module.decode.p25.message.tsbk.osp.control.CallAlert; -import module.decode.p25.message.tsbk.osp.control.DenyResponse; -import module.decode.p25.message.tsbk.osp.control.ExtendedFunctionCommand; -import module.decode.p25.message.tsbk.osp.control.GroupAffiliationQuery; -import module.decode.p25.message.tsbk.osp.control.GroupAffiliationResponse; -import module.decode.p25.message.tsbk.osp.control.IdentifierUpdateNonVUHF; -import module.decode.p25.message.tsbk.osp.control.IdentifierUpdateTDMA; -import module.decode.p25.message.tsbk.osp.control.IdentifierUpdateVUHF; -import module.decode.p25.message.tsbk.osp.control.LocationRegistrationResponse; -import module.decode.p25.message.tsbk.osp.control.MessageUpdate; -import module.decode.p25.message.tsbk.osp.control.NetworkStatusBroadcast; -import module.decode.p25.message.tsbk.osp.control.ProtectionParameterUpdate; -import module.decode.p25.message.tsbk.osp.control.QueuedResponse; -import module.decode.p25.message.tsbk.osp.control.RFSSStatusBroadcast; -import module.decode.p25.message.tsbk.osp.control.RadioUnitMonitorCommand; -import module.decode.p25.message.tsbk.osp.control.RoamingAddressCommand; -import module.decode.p25.message.tsbk.osp.control.SecondaryControlChannelBroadcast; -import module.decode.p25.message.tsbk.osp.control.SecondaryControlChannelBroadcastExplicit; -import module.decode.p25.message.tsbk.osp.control.StatusQuery; -import module.decode.p25.message.tsbk.osp.control.StatusUpdate; -import module.decode.p25.message.tsbk.osp.control.SyncBroadcast; -import module.decode.p25.message.tsbk.osp.control.SystemServiceBroadcast; -import module.decode.p25.message.tsbk.osp.control.TimeAndDateAnnouncement; -import module.decode.p25.message.tsbk.osp.control.UnitDeregistrationAcknowledge; -import module.decode.p25.message.tsbk.osp.control.UnitRegistrationCommand; -import module.decode.p25.message.tsbk.osp.control.UnitRegistrationResponse; -import module.decode.p25.message.tsbk.osp.data.GroupDataChannelAnnouncement; -import module.decode.p25.message.tsbk.osp.data.GroupDataChannelAnnouncementExplicit; -import module.decode.p25.message.tsbk.osp.data.GroupDataChannelGrant; -import module.decode.p25.message.tsbk.osp.data.IndividualDataChannelGrant; -import module.decode.p25.message.tsbk.osp.data.SNDCPDataChannelAnnouncementExplicit; -import module.decode.p25.message.tsbk.osp.data.SNDCPDataChannelGrant; -import module.decode.p25.message.tsbk.osp.data.SNDCPDataPageRequest; -import module.decode.p25.message.tsbk.osp.voice.GroupVoiceChannelGrant; -import module.decode.p25.message.tsbk.osp.voice.GroupVoiceChannelGrantUpdate; -import module.decode.p25.message.tsbk.osp.voice.GroupVoiceChannelGrantUpdateExplicit; -import module.decode.p25.message.tsbk.osp.voice.TelephoneInterconnectAnswerRequest; -import module.decode.p25.message.tsbk.osp.voice.TelephoneInterconnectVoiceChannelGrant; -import module.decode.p25.message.tsbk.osp.voice.UnitToUnitAnswerRequest; -import module.decode.p25.message.tsbk.osp.voice.UnitToUnitVoiceChannelGrant; -import module.decode.p25.message.tsbk.osp.voice.UnitToUnitVoiceChannelGrantUpdate; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import module.decode.p25.reference.Vendor; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.ControlChannelBaseStationIdentification; +import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.MotorolaOpcode; +import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.MotorolaTSBKMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.PatchGroupAdd; +import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.PatchGroupDelete; +import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.PatchGroupVoiceChannelGrant; +import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.PatchGroupVoiceChannelGrantUpdate; +import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.PlannedControlChannnelShutdown; +import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.SystemLoading; +import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.TrafficChannelBaseStationIdentification; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.AcknowledgeResponse; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.AdjacentStatusBroadcast; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.AuthenticationCommand; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.CallAlert; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.DenyResponse; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.ExtendedFunctionCommand; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.GroupAffiliationQuery; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.GroupAffiliationResponse; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.IdentifierUpdateNonVUHF; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.IdentifierUpdateTDMA; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.IdentifierUpdateVUHF; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.LocationRegistrationResponse; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.MessageUpdate; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.NetworkStatusBroadcast; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.ProtectionParameterUpdate; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.QueuedResponse; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.RFSSStatusBroadcast; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.RadioUnitMonitorCommand; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.RoamingAddressCommand; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SecondaryControlChannelBroadcast; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SecondaryControlChannelBroadcastExplicit; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.StatusQuery; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.StatusUpdate; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SyncBroadcast; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SystemServiceBroadcast; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.TimeAndDateAnnouncement; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.UnitDeregistrationAcknowledge; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.UnitRegistrationCommand; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.UnitRegistrationResponse; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.data.GroupDataChannelAnnouncement; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.data.GroupDataChannelAnnouncementExplicit; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.data.GroupDataChannelGrant; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.data.IndividualDataChannelGrant; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.data.SNDCPDataChannelAnnouncementExplicit; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.data.SNDCPDataChannelGrant; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.data.SNDCPDataPageRequest; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.GroupVoiceChannelGrant; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.GroupVoiceChannelGrantUpdate; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.GroupVoiceChannelGrantUpdateExplicit; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.TelephoneInterconnectAnswerRequest; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.TelephoneInterconnectVoiceChannelGrant; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.UnitToUnitAnswerRequest; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.UnitToUnitVoiceChannelGrant; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.UnitToUnitVoiceChannelGrantUpdate; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; +import io.github.dsheirer.module.decode.p25.reference.Vendor; public class TSBKMessageFactory { @@ -66,13 +66,13 @@ public class TSBKMessageFactory DataUnitID duid, AliasList aliasList ) { - Vendor vendor = Vendor.fromValue( + Vendor vendor = Vendor.fromValue( message.getInt( TSBKMessage.VENDOR_ID ) ); switch( vendor ) { case STANDARD: - Opcode opcode = + Opcode opcode = Opcode.fromValue( message.getInt( TSBKMessage.OPCODE ) ); switch( opcode ) diff --git a/src/module/decode/p25/message/tsbk/UnitChannelGrant.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/UnitChannelGrant.java similarity index 90% rename from src/module/decode/p25/message/tsbk/UnitChannelGrant.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/UnitChannelGrant.java index 90e8b476..61208f0d 100644 --- a/src/module/decode/p25/message/tsbk/UnitChannelGrant.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/UnitChannelGrant.java @@ -1,90 +1,90 @@ -/******************************************************************************* - * 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 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 - * - ******************************************************************************/ -package module.decode.p25.message.tsbk; - -import alias.Alias; -import alias.AliasList; -import bits.BinaryMessage; -import module.decode.p25.reference.DataUnitID; - -public abstract class UnitChannelGrant extends ChannelGrant -{ - public static final int[] TARGET_ADDRESS = {96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119}; - public static final int[] SOURCE_ADDRESS = {120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143}; - - public UnitChannelGrant(BinaryMessage message, DataUnitID duid, AliasList aliasList) - { - super(message, duid, aliasList); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append(getMessageStub()); - - if(isEmergency()) - { - sb.append(" EMERGENCY"); - } - - sb.append(" FROM:"); - sb.append(getSourceAddress()); - - sb.append(" TO:"); - sb.append(getTargetAddress()); - - return sb.toString(); - } - - public String getTargetAddress() - { - return mMessage.getHex(TARGET_ADDRESS, 6); - } - - public String getSourceAddress() - { - return mMessage.getHex(SOURCE_ADDRESS, 6); - } - - @Override - public String getFromID() - { - return getSourceAddress(); - } - - @Override - public Alias getFromIDAlias() - { - if(mAliasList != null) - { - return mAliasList.getTalkgroupAlias(getFromID()); - } - - return null; - } - - @Override - public String getToID() - { - return getTargetAddress(); - } -} +/******************************************************************************* + * 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 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 + * + ******************************************************************************/ +package io.github.dsheirer.module.decode.p25.message.tsbk; + +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; + +public abstract class UnitChannelGrant extends ChannelGrant +{ + public static final int[] TARGET_ADDRESS = {96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119}; + public static final int[] SOURCE_ADDRESS = {120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143}; + + public UnitChannelGrant(BinaryMessage message, DataUnitID duid, AliasList aliasList) + { + super(message, duid, aliasList); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append(getMessageStub()); + + if(isEmergency()) + { + sb.append(" EMERGENCY"); + } + + sb.append(" FROM:"); + sb.append(getSourceAddress()); + + sb.append(" TO:"); + sb.append(getTargetAddress()); + + return sb.toString(); + } + + public String getTargetAddress() + { + return mMessage.getHex(TARGET_ADDRESS, 6); + } + + public String getSourceAddress() + { + return mMessage.getHex(SOURCE_ADDRESS, 6); + } + + @Override + public String getFromID() + { + return getSourceAddress(); + } + + @Override + public Alias getFromIDAlias() + { + if(mAliasList != null) + { + return mAliasList.getTalkgroupAlias(getFromID()); + } + + return null; + } + + @Override + public String getToID() + { + return getTargetAddress(); + } +} diff --git a/src/module/decode/p25/message/tsbk/motorola/ControlChannelBaseStationIdentification.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/ControlChannelBaseStationIdentification.java similarity index 91% rename from src/module/decode/p25/message/tsbk/motorola/ControlChannelBaseStationIdentification.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/ControlChannelBaseStationIdentification.java index be11983f..f7e38182 100644 --- a/src/module/decode/p25/message/tsbk/motorola/ControlChannelBaseStationIdentification.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/ControlChannelBaseStationIdentification.java @@ -1,145 +1,145 @@ -/******************************************************************************* - * 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 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 - * - ******************************************************************************/ -package module.decode.p25.message.tsbk.motorola; - -import alias.AliasList; -import bits.BinaryMessage; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.reference.DataUnitID; - -public class ControlChannelBaseStationIdentification extends MotorolaTSBKMessage implements IdentifierReceiver -{ - public static final int[] CHARACTER_1 = {80, 81, 82, 83, 84, 85}; - public static final int[] CHARACTER_2 = {86, 87, 88, 89, 90, 91}; - public static final int[] CHARACTER_3 = {92, 93, 94, 95, 96, 97}; - public static final int[] CHARACTER_4 = {98, 99, 100, 101, 102, 103}; - public static final int[] CHARACTER_5 = {104, 105, 106, 107, 108, 109}; - public static final int[] CHARACTER_6 = {110, 111, 112, 113, 114, 115}; - public static final int[] CHARACTER_7 = {116, 117, 118, 119, 120, 121}; - public static final int[] CHARACTER_8 = {122, 123, 124, 125, 126, 127}; - - public static final int[] IDENTIFIER = {128, 129, 130, 131}; - public static final int[] CHANNEL = {132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143}; - - private IBandIdentifier mIdentifierUpdate; - - public ControlChannelBaseStationIdentification(BinaryMessage message, DataUnitID duid, AliasList aliasList) - { - super(message, duid, aliasList); - } - - @Override - public String getEventType() - { - return MotorolaOpcode.CONTROL_CHANNEL_ID.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append(getMessageStub()); - - sb.append(" CHAN:" + getIdentifier() + "-" + getChannel()); - - sb.append(" CWID:" + getCWID()); - - sb.append(" DN:" + getDownlinkFrequency()); - - sb.append(" UP:" + getUplinkFrequency()); - - return sb.toString(); - } - - - public String getCWID() - { - StringBuilder sb = new StringBuilder(); - - sb.append(getCharacter(CHARACTER_1)); - sb.append(getCharacter(CHARACTER_2)); - sb.append(getCharacter(CHARACTER_3)); - sb.append(getCharacter(CHARACTER_4)); - sb.append(getCharacter(CHARACTER_5)); - sb.append(getCharacter(CHARACTER_6)); - sb.append(getCharacter(CHARACTER_7)); - sb.append(getCharacter(CHARACTER_8)); - - return sb.toString(); - } - - private String getCharacter(int[] field) - { - int value = mMessage.getInt(field); - - if(value != 0) - { - return String.valueOf((char)(value + 43)); - } - - return null; - } - - public int getIdentifier() - { - return mMessage.getInt(IDENTIFIER); - } - - public int getChannel() - { - return mMessage.getInt(CHANNEL); - } - - public long getUplinkFrequency() - { - if(mIdentifierUpdate != null) - { - mIdentifierUpdate.getUplinkFrequency(getChannel()); - } - - return 0; - } - - public long getDownlinkFrequency() - { - if(mIdentifierUpdate != null) - { - mIdentifierUpdate.getDownlinkFrequency(getChannel()); - } - - return 0; - } - - @Override - public void setIdentifierMessage(int identifier, IBandIdentifier message) - { - mIdentifierUpdate = message; - } - - @Override - public int[] getIdentifiers() - { - int[] identifiers = new int[1]; - - identifiers[0] = getIdentifier(); - - return identifiers; - } -} +/******************************************************************************* + * 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 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 + * + ******************************************************************************/ +package io.github.dsheirer.module.decode.p25.message.tsbk.motorola; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; + +public class ControlChannelBaseStationIdentification extends MotorolaTSBKMessage implements IdentifierReceiver +{ + public static final int[] CHARACTER_1 = {80, 81, 82, 83, 84, 85}; + public static final int[] CHARACTER_2 = {86, 87, 88, 89, 90, 91}; + public static final int[] CHARACTER_3 = {92, 93, 94, 95, 96, 97}; + public static final int[] CHARACTER_4 = {98, 99, 100, 101, 102, 103}; + public static final int[] CHARACTER_5 = {104, 105, 106, 107, 108, 109}; + public static final int[] CHARACTER_6 = {110, 111, 112, 113, 114, 115}; + public static final int[] CHARACTER_7 = {116, 117, 118, 119, 120, 121}; + public static final int[] CHARACTER_8 = {122, 123, 124, 125, 126, 127}; + + public static final int[] IDENTIFIER = {128, 129, 130, 131}; + public static final int[] CHANNEL = {132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143}; + + private IBandIdentifier mIdentifierUpdate; + + public ControlChannelBaseStationIdentification(BinaryMessage message, DataUnitID duid, AliasList aliasList) + { + super(message, duid, aliasList); + } + + @Override + public String getEventType() + { + return MotorolaOpcode.CONTROL_CHANNEL_ID.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append(getMessageStub()); + + sb.append(" CHAN:" + getIdentifier() + "-" + getChannel()); + + sb.append(" CWID:" + getCWID()); + + sb.append(" DN:" + getDownlinkFrequency()); + + sb.append(" UP:" + getUplinkFrequency()); + + return sb.toString(); + } + + + public String getCWID() + { + StringBuilder sb = new StringBuilder(); + + sb.append(getCharacter(CHARACTER_1)); + sb.append(getCharacter(CHARACTER_2)); + sb.append(getCharacter(CHARACTER_3)); + sb.append(getCharacter(CHARACTER_4)); + sb.append(getCharacter(CHARACTER_5)); + sb.append(getCharacter(CHARACTER_6)); + sb.append(getCharacter(CHARACTER_7)); + sb.append(getCharacter(CHARACTER_8)); + + return sb.toString(); + } + + private String getCharacter(int[] field) + { + int value = mMessage.getInt(field); + + if(value != 0) + { + return String.valueOf((char)(value + 43)); + } + + return null; + } + + public int getIdentifier() + { + return mMessage.getInt(IDENTIFIER); + } + + public int getChannel() + { + return mMessage.getInt(CHANNEL); + } + + public long getUplinkFrequency() + { + if(mIdentifierUpdate != null) + { + mIdentifierUpdate.getUplinkFrequency(getChannel()); + } + + return 0; + } + + public long getDownlinkFrequency() + { + if(mIdentifierUpdate != null) + { + mIdentifierUpdate.getDownlinkFrequency(getChannel()); + } + + return 0; + } + + @Override + public void setIdentifierMessage(int identifier, IBandIdentifier message) + { + mIdentifierUpdate = message; + } + + @Override + public int[] getIdentifiers() + { + int[] identifiers = new int[1]; + + identifiers[0] = getIdentifier(); + + return identifiers; + } +} diff --git a/src/module/decode/p25/message/tsbk/motorola/MotorolaOpcode.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/MotorolaOpcode.java similarity index 98% rename from src/module/decode/p25/message/tsbk/motorola/MotorolaOpcode.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/MotorolaOpcode.java index d610874d..2e734ffb 100644 --- a/src/module/decode/p25/message/tsbk/motorola/MotorolaOpcode.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/MotorolaOpcode.java @@ -1,4 +1,4 @@ -package module.decode.p25.message.tsbk.motorola; +package io.github.dsheirer.module.decode.p25.message.tsbk.motorola; public enum MotorolaOpcode { diff --git a/src/module/decode/p25/message/tsbk/motorola/MotorolaTSBKMessage.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/MotorolaTSBKMessage.java similarity index 71% rename from src/module/decode/p25/message/tsbk/motorola/MotorolaTSBKMessage.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/MotorolaTSBKMessage.java index ad9d69d1..a85713ac 100644 --- a/src/module/decode/p25/message/tsbk/motorola/MotorolaTSBKMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/MotorolaTSBKMessage.java @@ -1,9 +1,9 @@ -package module.decode.p25.message.tsbk.motorola; +package io.github.dsheirer.module.decode.p25.message.tsbk.motorola; -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import alias.AliasList; -import bits.BinaryMessage; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; public class MotorolaTSBKMessage extends TSBKMessage { diff --git a/src/module/decode/p25/message/tsbk/motorola/PatchGroup.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroup.java similarity index 90% rename from src/module/decode/p25/message/tsbk/motorola/PatchGroup.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroup.java index 8d8c446d..b7a859a9 100644 --- a/src/module/decode/p25/message/tsbk/motorola/PatchGroup.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroup.java @@ -1,11 +1,10 @@ -package module.decode.p25.message.tsbk.motorola; +package io.github.dsheirer.module.decode.p25.message.tsbk.motorola; -import module.decode.p25.reference.DataUnitID; -import alias.AliasList; -import bits.BinaryMessage; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; public abstract class PatchGroup extends MotorolaTSBKMessage diff --git a/src/module/decode/p25/message/tsbk/motorola/PatchGroupAdd.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupAdd.java similarity index 58% rename from src/module/decode/p25/message/tsbk/motorola/PatchGroupAdd.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupAdd.java index 53e8504c..10244c95 100644 --- a/src/module/decode/p25/message/tsbk/motorola/PatchGroupAdd.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupAdd.java @@ -1,8 +1,8 @@ -package module.decode.p25.message.tsbk.motorola; +package io.github.dsheirer.module.decode.p25.message.tsbk.motorola; -import module.decode.p25.reference.DataUnitID; -import alias.AliasList; -import bits.BinaryMessage; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; public class PatchGroupAdd extends PatchGroup { diff --git a/src/module/decode/p25/message/tsbk/motorola/PatchGroupDelete.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupDelete.java similarity index 59% rename from src/module/decode/p25/message/tsbk/motorola/PatchGroupDelete.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupDelete.java index a8496d55..f3ddbfa1 100644 --- a/src/module/decode/p25/message/tsbk/motorola/PatchGroupDelete.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupDelete.java @@ -1,8 +1,8 @@ -package module.decode.p25.message.tsbk.motorola; +package io.github.dsheirer.module.decode.p25.message.tsbk.motorola; -import module.decode.p25.reference.DataUnitID; -import alias.AliasList; -import bits.BinaryMessage; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; public class PatchGroupDelete extends PatchGroup { diff --git a/src/module/decode/p25/message/tsbk/motorola/PatchGroupVoiceChannelGrant.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupVoiceChannelGrant.java similarity index 93% rename from src/module/decode/p25/message/tsbk/motorola/PatchGroupVoiceChannelGrant.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupVoiceChannelGrant.java index 54ab32c3..5d93b82f 100644 --- a/src/module/decode/p25/message/tsbk/motorola/PatchGroupVoiceChannelGrant.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupVoiceChannelGrant.java @@ -16,13 +16,13 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.tsbk.motorola; +package io.github.dsheirer.module.decode.p25.message.tsbk.motorola; -import alias.AliasList; -import bits.BinaryMessage; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; public class PatchGroupVoiceChannelGrant extends MotorolaTSBKMessage implements IdentifierReceiver { diff --git a/src/module/decode/p25/message/tsbk/motorola/PatchGroupVoiceChannelGrantUpdate.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupVoiceChannelGrantUpdate.java similarity index 93% rename from src/module/decode/p25/message/tsbk/motorola/PatchGroupVoiceChannelGrantUpdate.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupVoiceChannelGrantUpdate.java index e1ee6556..98b3b3f2 100644 --- a/src/module/decode/p25/message/tsbk/motorola/PatchGroupVoiceChannelGrantUpdate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupVoiceChannelGrantUpdate.java @@ -16,13 +16,13 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.tsbk.motorola; +package io.github.dsheirer.module.decode.p25.message.tsbk.motorola; -import alias.AliasList; -import bits.BinaryMessage; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; public class PatchGroupVoiceChannelGrantUpdate extends MotorolaTSBKMessage implements IdentifierReceiver { diff --git a/src/module/decode/p25/message/tsbk/motorola/PlannedControlChannnelShutdown.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PlannedControlChannnelShutdown.java similarity index 72% rename from src/module/decode/p25/message/tsbk/motorola/PlannedControlChannnelShutdown.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PlannedControlChannnelShutdown.java index 19f57c30..1654165d 100644 --- a/src/module/decode/p25/message/tsbk/motorola/PlannedControlChannnelShutdown.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PlannedControlChannnelShutdown.java @@ -1,30 +1,30 @@ -package module.decode.p25.message.tsbk.motorola; - -import module.decode.p25.reference.DataUnitID; -import alias.AliasList; -import bits.BinaryMessage; - -public class PlannedControlChannnelShutdown extends MotorolaTSBKMessage -{ - public PlannedControlChannnelShutdown( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return MotorolaOpcode.CCH_PLANNED_SHUTDOWN.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - - return sb.toString(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.motorola; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; + +public class PlannedControlChannnelShutdown extends MotorolaTSBKMessage +{ + public PlannedControlChannnelShutdown( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return MotorolaOpcode.CCH_PLANNED_SHUTDOWN.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + + return sb.toString(); + } +} diff --git a/src/module/decode/p25/message/tsbk/motorola/SystemLoading.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/SystemLoading.java similarity index 70% rename from src/module/decode/p25/message/tsbk/motorola/SystemLoading.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/SystemLoading.java index c86d442d..7e11128c 100644 --- a/src/module/decode/p25/message/tsbk/motorola/SystemLoading.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/SystemLoading.java @@ -1,8 +1,8 @@ -package module.decode.p25.message.tsbk.motorola; +package io.github.dsheirer.module.decode.p25.message.tsbk.motorola; -import module.decode.p25.reference.DataUnitID; -import alias.AliasList; -import bits.BinaryMessage; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; public class SystemLoading extends MotorolaTSBKMessage { diff --git a/src/module/decode/p25/message/tsbk/motorola/TrafficChannelBaseStationIdentification.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/TrafficChannelBaseStationIdentification.java similarity index 89% rename from src/module/decode/p25/message/tsbk/motorola/TrafficChannelBaseStationIdentification.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/TrafficChannelBaseStationIdentification.java index d55ea401..c833cb88 100644 --- a/src/module/decode/p25/message/tsbk/motorola/TrafficChannelBaseStationIdentification.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/TrafficChannelBaseStationIdentification.java @@ -1,65 +1,65 @@ -package module.decode.p25.message.tsbk.motorola; - -import module.decode.p25.reference.DataUnitID; -import alias.AliasList; -import bits.BinaryMessage; - -public class TrafficChannelBaseStationIdentification extends MotorolaTSBKMessage -{ - public static final int[] CHARACTER_1 = { 80,81,82,83,84,85 }; - public static final int[] CHARACTER_2 = { 86,87,88,89,90,91 }; - public static final int[] CHARACTER_3 = { 92,93,94,95,96,97 }; - public static final int[] CHARACTER_4 = { 98,99,100,101,102,103 }; - public static final int[] CHARACTER_5 = { 104,105,106,107,108,109 }; - public static final int[] CHARACTER_6 = { 110,111,112,113,114,115 }; - public static final int[] CHARACTER_7 = { 116,117,118,119,120,121 }; - public static final int[] CHARACTER_8 = { 122,123,124,125,126,127 }; - - public TrafficChannelBaseStationIdentification( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return MotorolaOpcode.TRAFFIC_CHANNEL_ID.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - - sb.append( " ID:" + getID() ); - - return sb.toString(); - } - - - public String getID() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getCharacter( CHARACTER_1 ) ); - sb.append( getCharacter( CHARACTER_2 ) ); - sb.append( getCharacter( CHARACTER_3 ) ); - sb.append( getCharacter( CHARACTER_4 ) ); - sb.append( getCharacter( CHARACTER_5 ) ); - sb.append( getCharacter( CHARACTER_6 ) ); - sb.append( getCharacter( CHARACTER_7 ) ); - sb.append( getCharacter( CHARACTER_8 ) ); - - return sb.toString(); - } - - private String getCharacter( int[] field ) - { - int value = mMessage.getInt( field ); - - return String.valueOf( (char)( value + 43 ) ); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.motorola; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; + +public class TrafficChannelBaseStationIdentification extends MotorolaTSBKMessage +{ + public static final int[] CHARACTER_1 = { 80,81,82,83,84,85 }; + public static final int[] CHARACTER_2 = { 86,87,88,89,90,91 }; + public static final int[] CHARACTER_3 = { 92,93,94,95,96,97 }; + public static final int[] CHARACTER_4 = { 98,99,100,101,102,103 }; + public static final int[] CHARACTER_5 = { 104,105,106,107,108,109 }; + public static final int[] CHARACTER_6 = { 110,111,112,113,114,115 }; + public static final int[] CHARACTER_7 = { 116,117,118,119,120,121 }; + public static final int[] CHARACTER_8 = { 122,123,124,125,126,127 }; + + public TrafficChannelBaseStationIdentification( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return MotorolaOpcode.TRAFFIC_CHANNEL_ID.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + + sb.append( " ID:" + getID() ); + + return sb.toString(); + } + + + public String getID() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getCharacter( CHARACTER_1 ) ); + sb.append( getCharacter( CHARACTER_2 ) ); + sb.append( getCharacter( CHARACTER_3 ) ); + sb.append( getCharacter( CHARACTER_4 ) ); + sb.append( getCharacter( CHARACTER_5 ) ); + sb.append( getCharacter( CHARACTER_6 ) ); + sb.append( getCharacter( CHARACTER_7 ) ); + sb.append( getCharacter( CHARACTER_8 ) ); + + return sb.toString(); + } + + private String getCharacter( int[] field ) + { + int value = mMessage.getInt( field ); + + return String.valueOf( (char)( value + 43 ) ); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/control/AcknowledgeResponse.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/AcknowledgeResponse.java similarity index 89% rename from src/module/decode/p25/message/tsbk/osp/control/AcknowledgeResponse.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/AcknowledgeResponse.java index 5e0bc56c..fd9424b8 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/AcknowledgeResponse.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/AcknowledgeResponse.java @@ -1,121 +1,121 @@ -package module.decode.p25.message.tsbk.osp.control; - -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class AcknowledgeResponse extends TSBKMessage -{ - public static final int ADDITIONAL_INFORMATION_FLAG = 80; - public static final int EXTENDED_ADDRESS_FLAG = 81; - public static final int[] SERVICE_TYPE = { 82,83,84,85,86,87 }; - public static final int[] WACN = { 88,89,90,91,92,93,94,95,96,97,98,99,100, - 101,102,103,104,105,106,107 }; - public static final int[] SYSTEM_ID = { 108,109,110,111,112,113,114,115,116, - 117,118,119 }; - public static final int[] SOURCE_ADDRESS = { 96,97,98,99,100,101,102,103, - 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119 }; - public static final int[] TARGET_ADDRESS = { 120,121,122,123,124,125,126, - 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; - - public AcknowledgeResponse( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.ACKNOWLEDGE_RESPONSE.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - - sb.append( " SVC TYPE: " + getServiceType() ); - - if( hasAdditionalInformation() ) - { - if( hasExtendedAddress() ) - { - sb.append( " WACN: " + getWACN() ); - sb.append( " SYS ID: " + getSystemID() ); - } - else - { - sb.append( " SRC: " + getSourceAddress() ); - } - } - - return sb.toString(); - } - - public boolean hasAdditionalInformation() - { - return mMessage.get( ADDITIONAL_INFORMATION_FLAG ); - } - - public boolean hasExtendedAddress() - { - return mMessage.get( EXTENDED_ADDRESS_FLAG ); - } - - public String getServiceType() - { - return mMessage.getHex( SERVICE_TYPE, 2 ); - } - - public String getWACN() - { - if( hasAdditionalInformation() && !hasExtendedAddress() ) - { - return mMessage.getHex( WACN, 5 ); - } - - return null; - } - - public String getSystemID() - { - if( hasAdditionalInformation() && !hasExtendedAddress() ) - { - return mMessage.getHex( SYSTEM_ID, 3 ); - } - - return null; - } - - public String getSourceAddress() - { - if( hasAdditionalInformation() && !hasExtendedAddress() ) - { - return mMessage.getHex( SOURCE_ADDRESS, 6 ); - } - - return null; - } - - @Override - public String getFromID() - { - return getSourceAddress(); - } - - public String getTargetAddress() - { - return mMessage.getHex( TARGET_ADDRESS, 6 ); - } - - @Override - public String getToID() - { - return getTargetAddress(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class AcknowledgeResponse extends TSBKMessage +{ + public static final int ADDITIONAL_INFORMATION_FLAG = 80; + public static final int EXTENDED_ADDRESS_FLAG = 81; + public static final int[] SERVICE_TYPE = { 82,83,84,85,86,87 }; + public static final int[] WACN = { 88,89,90,91,92,93,94,95,96,97,98,99,100, + 101,102,103,104,105,106,107 }; + public static final int[] SYSTEM_ID = { 108,109,110,111,112,113,114,115,116, + 117,118,119 }; + public static final int[] SOURCE_ADDRESS = { 96,97,98,99,100,101,102,103, + 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119 }; + public static final int[] TARGET_ADDRESS = { 120,121,122,123,124,125,126, + 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; + + public AcknowledgeResponse( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.ACKNOWLEDGE_RESPONSE.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + + sb.append( " SVC TYPE: " + getServiceType() ); + + if( hasAdditionalInformation() ) + { + if( hasExtendedAddress() ) + { + sb.append( " WACN: " + getWACN() ); + sb.append( " SYS ID: " + getSystemID() ); + } + else + { + sb.append( " SRC: " + getSourceAddress() ); + } + } + + return sb.toString(); + } + + public boolean hasAdditionalInformation() + { + return mMessage.get( ADDITIONAL_INFORMATION_FLAG ); + } + + public boolean hasExtendedAddress() + { + return mMessage.get( EXTENDED_ADDRESS_FLAG ); + } + + public String getServiceType() + { + return mMessage.getHex( SERVICE_TYPE, 2 ); + } + + public String getWACN() + { + if( hasAdditionalInformation() && !hasExtendedAddress() ) + { + return mMessage.getHex( WACN, 5 ); + } + + return null; + } + + public String getSystemID() + { + if( hasAdditionalInformation() && !hasExtendedAddress() ) + { + return mMessage.getHex( SYSTEM_ID, 3 ); + } + + return null; + } + + public String getSourceAddress() + { + if( hasAdditionalInformation() && !hasExtendedAddress() ) + { + return mMessage.getHex( SOURCE_ADDRESS, 6 ); + } + + return null; + } + + @Override + public String getFromID() + { + return getSourceAddress(); + } + + public String getTargetAddress() + { + return mMessage.getHex( TARGET_ADDRESS, 6 ); + } + + @Override + public String getToID() + { + return getTargetAddress(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/control/AdjacentStatusBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/AdjacentStatusBroadcast.java similarity index 89% rename from src/module/decode/p25/message/tsbk/osp/control/AdjacentStatusBroadcast.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/AdjacentStatusBroadcast.java index 4ff1a876..f2adf300 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/AdjacentStatusBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/AdjacentStatusBroadcast.java @@ -1,216 +1,216 @@ -/******************************************************************************* - * 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 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 - * - ******************************************************************************/ -package module.decode.p25.message.tsbk.osp.control; - -import alias.AliasList; -import bits.BinaryMessage; -import module.decode.p25.message.IAdjacentSite; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; - -public class AdjacentStatusBroadcast extends TSBKMessage implements IdentifierReceiver, IAdjacentSite -{ - public static final int[] LOCATION_REGISTRATION_AREA = {80, 81, 82, 83, 84, 85, 86, 87}; - public static final int CONVENTIONAL_CHANNEL_FLAG = 88; - public static final int SITE_FAILURE_CONDITION_FLAG = 89; - public static final int VALID_FLAG = 90; - public static final int ACTIVE_NETWORK_CONNECTION_FLAG = 91; - public static final int[] SYSTEM_ID = {92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103}; - public static final int[] RFSS_ID = {104, 105, 106, 107, 108, 109, 110, 111}; - public static final int[] SITE_ID = {112, 113, 114, 115, 116, 117, 118, 119}; - public static final int[] IDENTIFIER = {120, 121, 122, 123}; - public static final int[] CHANNEL = {124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135}; - public static final int[] SYSTEM_SERVICE_CLASS = {136, 137, 138, 139, 140, 141, 142, 143}; - - private IBandIdentifier mIdentifierUpdate; - - public AdjacentStatusBroadcast(BinaryMessage message, DataUnitID duid, AliasList aliasList) - { - super(message, duid, aliasList); - } - - @Override - public String getEventType() - { - return Opcode.ADJACENT_STATUS_BROADCAST.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append(getMessageStub()); - - sb.append(" LRA:" + getLRA()); - - sb.append(" SYS:" + getSystemID()); - - sb.append(" SITE:" + getRFSS() + "-" + getSiteID()); - - sb.append(" CHAN:" + getIdentifier() + "-" + getChannel()); - - sb.append(" DN:" + getDownlinkFrequency()); - - sb.append(" UP:" + getUplinkFrequency()); - - if(isConventionalChannel()) - { - sb.append(" CONVENTIONAL"); - } - - if(isSiteFailureCondition()) - { - sb.append(" FAILURE-CONDITION"); - } - - if(isValidSiteInformation()) - { - sb.append(" VALID-INFO"); - } - - if(hasActiveNetworkConnection()) - { - sb.append(" ACTIVE-NETWORK-CONN"); - } - - sb.append(getSystemServiceClass()); - - return sb.toString(); - } - - @Override - public String getDownlinkChannel() - { - return getIdentifier() + "-" + getChannel(); - } - - @Override - public String getUplinkChannel() - { - return getIdentifier() + "-" + getChannel(); - } - - public String getLRA() - { - return mMessage.getHex(LOCATION_REGISTRATION_AREA, 2); - } - - public boolean isConventionalChannel() - { - return mMessage.get(CONVENTIONAL_CHANNEL_FLAG); - } - - public boolean isSiteFailureCondition() - { - return mMessage.get(SITE_FAILURE_CONDITION_FLAG); - } - - public boolean isValidSiteInformation() - { - return mMessage.get(VALID_FLAG); - } - - public boolean hasActiveNetworkConnection() - { - return mMessage.get(ACTIVE_NETWORK_CONNECTION_FLAG); - } - - public String getUniqueID() - { - StringBuilder sb = new StringBuilder(); - - sb.append(getSystemID()); - sb.append(":"); - sb.append(getRFSS()); - sb.append(":"); - sb.append(getSiteID()); - - return sb.toString(); - } - - public String getSystemID() - { - return mMessage.getHex(SYSTEM_ID, 3); - } - - public String getRFSS() - { - return mMessage.getHex(RFSS_ID, 2); - } - - public String getSiteID() - { - return mMessage.getHex(SITE_ID, 2); - } - - public int getChannel() - { - return mMessage.getInt(CHANNEL); - } - - public int getIdentifier() - { - return mMessage.getInt(IDENTIFIER); - } - - public String getSystemServiceClass() - { - return SystemService.toString(mMessage.getInt(SYSTEM_SERVICE_CLASS)); - } - - public long getDownlinkFrequency() - { - if(mIdentifierUpdate != null) - { - return mIdentifierUpdate.getDownlinkFrequency(getChannel()); - } - - return 0; - } - - public long getUplinkFrequency() - { - if(mIdentifierUpdate != null) - { - return mIdentifierUpdate.getUplinkFrequency(getChannel()); - } - - return 0; - } - - - @Override - public void setIdentifierMessage(int identifier, IBandIdentifier message) - { - /* we're only expecting 1 identifier, so use whatever is received */ - mIdentifierUpdate = message; - } - - public int[] getIdentifiers() - { - int[] idens = new int[1]; - - idens[0] = getIdentifier(); - - return idens; - } -} +/******************************************************************************* + * 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 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 + * + ******************************************************************************/ +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.IAdjacentSite; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class AdjacentStatusBroadcast extends TSBKMessage implements IdentifierReceiver, IAdjacentSite +{ + public static final int[] LOCATION_REGISTRATION_AREA = {80, 81, 82, 83, 84, 85, 86, 87}; + public static final int CONVENTIONAL_CHANNEL_FLAG = 88; + public static final int SITE_FAILURE_CONDITION_FLAG = 89; + public static final int VALID_FLAG = 90; + public static final int ACTIVE_NETWORK_CONNECTION_FLAG = 91; + public static final int[] SYSTEM_ID = {92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103}; + public static final int[] RFSS_ID = {104, 105, 106, 107, 108, 109, 110, 111}; + public static final int[] SITE_ID = {112, 113, 114, 115, 116, 117, 118, 119}; + public static final int[] IDENTIFIER = {120, 121, 122, 123}; + public static final int[] CHANNEL = {124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135}; + public static final int[] SYSTEM_SERVICE_CLASS = {136, 137, 138, 139, 140, 141, 142, 143}; + + private IBandIdentifier mIdentifierUpdate; + + public AdjacentStatusBroadcast(BinaryMessage message, DataUnitID duid, AliasList aliasList) + { + super(message, duid, aliasList); + } + + @Override + public String getEventType() + { + return Opcode.ADJACENT_STATUS_BROADCAST.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append(getMessageStub()); + + sb.append(" LRA:" + getLRA()); + + sb.append(" SYS:" + getSystemID()); + + sb.append(" SITE:" + getRFSS() + "-" + getSiteID()); + + sb.append(" CHAN:" + getIdentifier() + "-" + getChannel()); + + sb.append(" DN:" + getDownlinkFrequency()); + + sb.append(" UP:" + getUplinkFrequency()); + + if(isConventionalChannel()) + { + sb.append(" CONVENTIONAL"); + } + + if(isSiteFailureCondition()) + { + sb.append(" FAILURE-CONDITION"); + } + + if(isValidSiteInformation()) + { + sb.append(" VALID-INFO"); + } + + if(hasActiveNetworkConnection()) + { + sb.append(" ACTIVE-NETWORK-CONN"); + } + + sb.append(getSystemServiceClass()); + + return sb.toString(); + } + + @Override + public String getDownlinkChannel() + { + return getIdentifier() + "-" + getChannel(); + } + + @Override + public String getUplinkChannel() + { + return getIdentifier() + "-" + getChannel(); + } + + public String getLRA() + { + return mMessage.getHex(LOCATION_REGISTRATION_AREA, 2); + } + + public boolean isConventionalChannel() + { + return mMessage.get(CONVENTIONAL_CHANNEL_FLAG); + } + + public boolean isSiteFailureCondition() + { + return mMessage.get(SITE_FAILURE_CONDITION_FLAG); + } + + public boolean isValidSiteInformation() + { + return mMessage.get(VALID_FLAG); + } + + public boolean hasActiveNetworkConnection() + { + return mMessage.get(ACTIVE_NETWORK_CONNECTION_FLAG); + } + + public String getUniqueID() + { + StringBuilder sb = new StringBuilder(); + + sb.append(getSystemID()); + sb.append(":"); + sb.append(getRFSS()); + sb.append(":"); + sb.append(getSiteID()); + + return sb.toString(); + } + + public String getSystemID() + { + return mMessage.getHex(SYSTEM_ID, 3); + } + + public String getRFSS() + { + return mMessage.getHex(RFSS_ID, 2); + } + + public String getSiteID() + { + return mMessage.getHex(SITE_ID, 2); + } + + public int getChannel() + { + return mMessage.getInt(CHANNEL); + } + + public int getIdentifier() + { + return mMessage.getInt(IDENTIFIER); + } + + public String getSystemServiceClass() + { + return SystemService.toString(mMessage.getInt(SYSTEM_SERVICE_CLASS)); + } + + public long getDownlinkFrequency() + { + if(mIdentifierUpdate != null) + { + return mIdentifierUpdate.getDownlinkFrequency(getChannel()); + } + + return 0; + } + + public long getUplinkFrequency() + { + if(mIdentifierUpdate != null) + { + return mIdentifierUpdate.getUplinkFrequency(getChannel()); + } + + return 0; + } + + + @Override + public void setIdentifierMessage(int identifier, IBandIdentifier message) + { + /* we're only expecting 1 identifier, so use whatever is received */ + mIdentifierUpdate = message; + } + + public int[] getIdentifiers() + { + int[] idens = new int[1]; + + idens[0] = getIdentifier(); + + return idens; + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/control/AuthenticationCommand.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/AuthenticationCommand.java similarity index 83% rename from src/module/decode/p25/message/tsbk/osp/control/AuthenticationCommand.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/AuthenticationCommand.java index 8fc0f6b2..c782be73 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/AuthenticationCommand.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/AuthenticationCommand.java @@ -1,77 +1,77 @@ -package module.decode.p25.message.tsbk.osp.control; - -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class AuthenticationCommand extends TSBKMessage -{ - public static final int[] WACN = { 88,89,90,91,92,93,94,95,96,97,98,99,100, - 101,102,103,104,105,106,107 }; - public static final int[] SYSTEM_ID = { 108,109,110,111,112,113,114,115,116, - 117,118,119 }; - public static final int[] TARGET_ID = { 120,121,122,123,124,125,126, - 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; - - public AuthenticationCommand( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.AUTHENTICATION_COMMAND.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - - sb.append( " WACN: " + getWACN() ); - sb.append( " SYS ID: " + getSystemID() ); - sb.append( " TGT ID: " + getTargetID() ); - - return sb.toString(); - } - - public String getWACN() - { - return mMessage.getHex( WACN, 5 ); - } - - public String getSystemID() - { - return mMessage.getHex( SYSTEM_ID, 3 ); - } - - public String getTargetID() - { - return mMessage.getHex( TARGET_ID, 6 ); - } - - public String getFullTargetID() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getWACN() ); - sb.append( "-" ); - sb.append( getSystemID() ); - sb.append( "-" ); - sb.append( getTargetID() ); - - return sb.toString(); - } - - @Override - public String getToID() - { - return getTargetID(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class AuthenticationCommand extends TSBKMessage +{ + public static final int[] WACN = { 88,89,90,91,92,93,94,95,96,97,98,99,100, + 101,102,103,104,105,106,107 }; + public static final int[] SYSTEM_ID = { 108,109,110,111,112,113,114,115,116, + 117,118,119 }; + public static final int[] TARGET_ID = { 120,121,122,123,124,125,126, + 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; + + public AuthenticationCommand( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.AUTHENTICATION_COMMAND.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + + sb.append( " WACN: " + getWACN() ); + sb.append( " SYS ID: " + getSystemID() ); + sb.append( " TGT ID: " + getTargetID() ); + + return sb.toString(); + } + + public String getWACN() + { + return mMessage.getHex( WACN, 5 ); + } + + public String getSystemID() + { + return mMessage.getHex( SYSTEM_ID, 3 ); + } + + public String getTargetID() + { + return mMessage.getHex( TARGET_ID, 6 ); + } + + public String getFullTargetID() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getWACN() ); + sb.append( "-" ); + sb.append( getSystemID() ); + sb.append( "-" ); + sb.append( getTargetID() ); + + return sb.toString(); + } + + @Override + public String getToID() + { + return getTargetID(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/control/CallAlert.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/CallAlert.java similarity index 79% rename from src/module/decode/p25/message/tsbk/osp/control/CallAlert.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/CallAlert.java index ce95f61f..7673d368 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/CallAlert.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/CallAlert.java @@ -1,62 +1,62 @@ -package module.decode.p25.message.tsbk.osp.control; - -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class CallAlert extends TSBKMessage -{ - public static final int[] TARGET_ADDRESS = { 96,97,98,99,100,101,102,103, - 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119 }; - public static final int[] SOURCE_ID = { 120,121,122,123,124,125,126, - 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; - - public CallAlert( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.CALL_ALERT.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - - sb.append( " SRC ID: " + getSourceID() ); - sb.append( " TGT ADDR: " + getTargetAddress() ); - - return sb.toString(); - } - - public String getSourceID() - { - return mMessage.getHex( SOURCE_ID, 6 ); - } - - @Override - public String getFromID() - { - return getSourceID(); - } - - public String getTargetAddress() - { - return mMessage.getHex( TARGET_ADDRESS, 6 ); - } - - @Override - public String getToID() - { - return getTargetAddress(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class CallAlert extends TSBKMessage +{ + public static final int[] TARGET_ADDRESS = { 96,97,98,99,100,101,102,103, + 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119 }; + public static final int[] SOURCE_ID = { 120,121,122,123,124,125,126, + 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; + + public CallAlert( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.CALL_ALERT.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + + sb.append( " SRC ID: " + getSourceID() ); + sb.append( " TGT ADDR: " + getTargetAddress() ); + + return sb.toString(); + } + + public String getSourceID() + { + return mMessage.getHex( SOURCE_ID, 6 ); + } + + @Override + public String getFromID() + { + return getSourceID(); + } + + public String getTargetAddress() + { + return mMessage.getHex( TARGET_ADDRESS, 6 ); + } + + @Override + public String getToID() + { + return getTargetAddress(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/control/DenyResponse.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/DenyResponse.java similarity index 84% rename from src/module/decode/p25/message/tsbk/osp/control/DenyResponse.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/DenyResponse.java index 7e3e67fe..e1895272 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/DenyResponse.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/DenyResponse.java @@ -1,95 +1,95 @@ -package module.decode.p25.message.tsbk.osp.control; - -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.DenyReason; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class DenyResponse extends TSBKMessage -{ - public static final int ADDITIONAL_INFORMATION_FLAG = 80; - public static final int[] SERVICE_TYPE = { 82,83,84,85,86,87 }; - public static final int[] REASON_CODE = { 88,89,90,91,92,93,94,95 }; - - public static final int[] CALL_OPTIONS = { 96,97,98,99,100,101,102,103 }; - public static final int[] SOURCE_GROUP = { 104,105,106,107,108,109,110,111 }; - public static final int[] SOURCE_ADDRESS = { 96,97,98,99,100,101,102,103,104, - 105,106,107,108,109,110,111 }; - - public static final int[] TARGET_ADDRESS = { 120,121,122,123,124,125,126, - 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; - - public DenyResponse( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.DENY_RESPONSE.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - - sb.append( " TGT ADDR: " + getTargetAddress() ); - - sb.append( " REASON:" + getReason().name() ); - - return sb.toString(); - } - - public DenyReason getReason() - { - int code = mMessage.getInt( REASON_CODE ); - - return DenyReason.fromCode( code ); - } - - public boolean hasAdditionalInformation() - { - return mMessage.get( ADDITIONAL_INFORMATION_FLAG ); - } - - public Opcode getServiceType() - { - return Opcode.fromValue( mMessage.getInt( SERVICE_TYPE ) ); - } - - public String getSourceAddress() - { - switch( getServiceType() ) - { - case GROUP_DATA_CHANNEL_GRANT: - case GROUP_VOICE_CHANNEL_GRANT: - return mMessage.getHex( SOURCE_GROUP, 4 ); - case UNIT_TO_UNIT_VOICE_CHANNEL_GRANT: - case INDIVIDUAL_DATA_CHANNEL_GRANT: - case TELEPHONE_INTERCONNECT_VOICE_CHANNEL_GRANT: - return mMessage.getHex( SOURCE_ADDRESS, 6 ); - default: - break; - } - - return null; - } - - public String getTargetAddress() - { - return mMessage.getHex( TARGET_ADDRESS, 6 ); - } - - @Override - public String getToID() - { - return getTargetAddress(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.DenyReason; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class DenyResponse extends TSBKMessage +{ + public static final int ADDITIONAL_INFORMATION_FLAG = 80; + public static final int[] SERVICE_TYPE = { 82,83,84,85,86,87 }; + public static final int[] REASON_CODE = { 88,89,90,91,92,93,94,95 }; + + public static final int[] CALL_OPTIONS = { 96,97,98,99,100,101,102,103 }; + public static final int[] SOURCE_GROUP = { 104,105,106,107,108,109,110,111 }; + public static final int[] SOURCE_ADDRESS = { 96,97,98,99,100,101,102,103,104, + 105,106,107,108,109,110,111 }; + + public static final int[] TARGET_ADDRESS = { 120,121,122,123,124,125,126, + 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; + + public DenyResponse( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.DENY_RESPONSE.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + + sb.append( " TGT ADDR: " + getTargetAddress() ); + + sb.append( " REASON:" + getReason().name() ); + + return sb.toString(); + } + + public DenyReason getReason() + { + int code = mMessage.getInt( REASON_CODE ); + + return DenyReason.fromCode( code ); + } + + public boolean hasAdditionalInformation() + { + return mMessage.get( ADDITIONAL_INFORMATION_FLAG ); + } + + public Opcode getServiceType() + { + return Opcode.fromValue( mMessage.getInt( SERVICE_TYPE ) ); + } + + public String getSourceAddress() + { + switch( getServiceType() ) + { + case GROUP_DATA_CHANNEL_GRANT: + case GROUP_VOICE_CHANNEL_GRANT: + return mMessage.getHex( SOURCE_GROUP, 4 ); + case UNIT_TO_UNIT_VOICE_CHANNEL_GRANT: + case INDIVIDUAL_DATA_CHANNEL_GRANT: + case TELEPHONE_INTERCONNECT_VOICE_CHANNEL_GRANT: + return mMessage.getHex( SOURCE_ADDRESS, 6 ); + default: + break; + } + + return null; + } + + public String getTargetAddress() + { + return mMessage.getHex( TARGET_ADDRESS, 6 ); + } + + @Override + public String getToID() + { + return getTargetAddress(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/control/ExtendedFunctionCommand.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/ExtendedFunctionCommand.java similarity index 82% rename from src/module/decode/p25/message/tsbk/osp/control/ExtendedFunctionCommand.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/ExtendedFunctionCommand.java index 92cd17e8..ebd70c75 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/ExtendedFunctionCommand.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/ExtendedFunctionCommand.java @@ -1,87 +1,87 @@ -package module.decode.p25.message.tsbk.osp.control; - -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.ExtendedFunction; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class ExtendedFunctionCommand extends TSBKMessage -{ - public static final int[] EXTENDED_FUNCTION = { 80,81,82,83,84,85,86,87, - 88,89,90,91,92,93,94,95 }; - public static final int[] ARGUMENT = { 96,97,98,99,100,101,102,103,104,105, - 106,107,108,109,110,111,112,113,114,115,116,117,118,119 }; - public static final int[] TARGET_ADDRESS = { 120,121,122,123,124,125,126, - 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; - - public ExtendedFunctionCommand( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.EXTENDED_FUNCTION_COMMAND.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - - sb.append( " EXTENDED FUNCTION:" + getExtendedFunction().getLabel() ); - - sb.append( " ARGUMENT: " + getTargetAddress() ); - - sb.append( " TGT ADDR: " + getTargetAddress() ); - - return sb.toString(); - } - - public ExtendedFunction getExtendedFunction() - { - return ExtendedFunction.fromValue( mMessage.getInt( EXTENDED_FUNCTION ) ); - } - - public String getArgument() - { - return mMessage.getHex( ARGUMENT, 6 ); - } - - public String getSourceAddress() - { - switch( getExtendedFunction() ) - { - case RADIO_CHECK: - case RADIO_CHECK_ACK: - case RADIO_DETACH: - case RADIO_DETACH_ACK: - case RADIO_INHIBIT: - case RADIO_INHIBIT_ACK: - case RADIO_UNINHIBIT: - case RADIO_UNINHIBIT_ACK: - return getArgument(); - default: - break; - } - - return null; - } - - public String getTargetAddress() - { - return mMessage.getHex( TARGET_ADDRESS, 6 ); - } - - @Override - public String getToID() - { - return getTargetAddress(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.ExtendedFunction; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class ExtendedFunctionCommand extends TSBKMessage +{ + public static final int[] EXTENDED_FUNCTION = { 80,81,82,83,84,85,86,87, + 88,89,90,91,92,93,94,95 }; + public static final int[] ARGUMENT = { 96,97,98,99,100,101,102,103,104,105, + 106,107,108,109,110,111,112,113,114,115,116,117,118,119 }; + public static final int[] TARGET_ADDRESS = { 120,121,122,123,124,125,126, + 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; + + public ExtendedFunctionCommand( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.EXTENDED_FUNCTION_COMMAND.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + + sb.append( " EXTENDED FUNCTION:" + getExtendedFunction().getLabel() ); + + sb.append( " ARGUMENT: " + getTargetAddress() ); + + sb.append( " TGT ADDR: " + getTargetAddress() ); + + return sb.toString(); + } + + public ExtendedFunction getExtendedFunction() + { + return ExtendedFunction.fromValue( mMessage.getInt( EXTENDED_FUNCTION ) ); + } + + public String getArgument() + { + return mMessage.getHex( ARGUMENT, 6 ); + } + + public String getSourceAddress() + { + switch( getExtendedFunction() ) + { + case RADIO_CHECK: + case RADIO_CHECK_ACK: + case RADIO_DETACH: + case RADIO_DETACH_ACK: + case RADIO_INHIBIT: + case RADIO_INHIBIT_ACK: + case RADIO_UNINHIBIT: + case RADIO_UNINHIBIT_ACK: + return getArgument(); + default: + break; + } + + return null; + } + + public String getTargetAddress() + { + return mMessage.getHex( TARGET_ADDRESS, 6 ); + } + + @Override + public String getToID() + { + return getTargetAddress(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/control/GroupAffiliationQuery.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/GroupAffiliationQuery.java similarity index 79% rename from src/module/decode/p25/message/tsbk/osp/control/GroupAffiliationQuery.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/GroupAffiliationQuery.java index 683ab076..72d3e0d9 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/GroupAffiliationQuery.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/GroupAffiliationQuery.java @@ -1,63 +1,63 @@ -package module.decode.p25.message.tsbk.osp.control; - -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class GroupAffiliationQuery extends TSBKMessage -{ - public static final int[] TARGET_ADDRESS = { 96,97,98,99,100,101,102,103, - 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119 }; - public static final int[] SOURCE_ADDRESS = { 120,121,122,123,124,125,126, - 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; - - public GroupAffiliationQuery( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.GROUP_AFFILIATION_QUERY.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - - sb.append( " SRC ADDR: " + getSourceAddress() ); - - sb.append( " TGT ADDR: " + getTargetAddress() ); - - return sb.toString(); - } - - public String getSourceAddress() - { - return mMessage.getHex( SOURCE_ADDRESS, 6 ); - } - - @Override - public String getFromID() - { - return getSourceAddress(); - } - - public String getTargetAddress() - { - return mMessage.getHex( TARGET_ADDRESS, 6 ); - } - - @Override - public String getToID() - { - return getTargetAddress(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class GroupAffiliationQuery extends TSBKMessage +{ + public static final int[] TARGET_ADDRESS = { 96,97,98,99,100,101,102,103, + 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119 }; + public static final int[] SOURCE_ADDRESS = { 120,121,122,123,124,125,126, + 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; + + public GroupAffiliationQuery( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.GROUP_AFFILIATION_QUERY.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + + sb.append( " SRC ADDR: " + getSourceAddress() ); + + sb.append( " TGT ADDR: " + getTargetAddress() ); + + return sb.toString(); + } + + public String getSourceAddress() + { + return mMessage.getHex( SOURCE_ADDRESS, 6 ); + } + + @Override + public String getFromID() + { + return getSourceAddress(); + } + + public String getTargetAddress() + { + return mMessage.getHex( TARGET_ADDRESS, 6 ); + } + + @Override + public String getToID() + { + return getTargetAddress(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/control/GroupAffiliationResponse.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/GroupAffiliationResponse.java similarity index 84% rename from src/module/decode/p25/message/tsbk/osp/control/GroupAffiliationResponse.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/GroupAffiliationResponse.java index 2c964a0c..596902d2 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/GroupAffiliationResponse.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/GroupAffiliationResponse.java @@ -1,86 +1,86 @@ -package module.decode.p25.message.tsbk.osp.control; - -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import module.decode.p25.reference.Response; -import alias.AliasList; -import bits.BinaryMessage; - -public class GroupAffiliationResponse extends TSBKMessage -{ - public static final int LOCAL_GLOBAL_AFFILIATION_FLAG = 80; - public static final int[] AFFILIATION_RESPONSE = { 86,87 }; - public static final int[] ANNOUNCEMENT_GROUP_ADDRESS = { 88,89,90,91, - 92,93,94,95,96,97,98,99,100,101,102,103 }; - public static final int[] GROUP_ADDRESS = { 104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119 }; - public static final int[] TARGET_ADDRESS = { 120,121,122,123,124,125,126, - 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; - - public GroupAffiliationResponse( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.GROUP_AFFILIATION_RESPONSE.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - - sb.append( " AFFILIATION:" + getResponse().name() ); - sb.append( " ANNOUNCE GROUP:" + getAnnouncementGroupAddress() ); - sb.append( " GRP ADDR:" + getGroupAddress() ); - sb.append( " TGT ADDR: " + getTargetAddress() ); - - return sb.toString(); - } - - public String getAffiliationScope() - { - return mMessage.get( LOCAL_GLOBAL_AFFILIATION_FLAG) ? " GLOBAL" : " LOCAL"; - } - - public Response getResponse() - { - int response = mMessage.getInt( AFFILIATION_RESPONSE ); - - return Response.fromValue( response ); - } - - public String getAnnouncementGroupAddress() - { - return mMessage.getHex( ANNOUNCEMENT_GROUP_ADDRESS, 4 ); - } - - public String getGroupAddress() - { - return mMessage.getHex( GROUP_ADDRESS, 4 ); - } - - @Override - public String getFromID() - { - return getGroupAddress(); - } - - public String getTargetAddress() - { - return mMessage.getHex( TARGET_ADDRESS, 6 ); - } - - @Override - public String getToID() - { - return getTargetAddress(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; +import io.github.dsheirer.module.decode.p25.reference.Response; + +public class GroupAffiliationResponse extends TSBKMessage +{ + public static final int LOCAL_GLOBAL_AFFILIATION_FLAG = 80; + public static final int[] AFFILIATION_RESPONSE = { 86,87 }; + public static final int[] ANNOUNCEMENT_GROUP_ADDRESS = { 88,89,90,91, + 92,93,94,95,96,97,98,99,100,101,102,103 }; + public static final int[] GROUP_ADDRESS = { 104,105,106,107,108,109,110,111, + 112,113,114,115,116,117,118,119 }; + public static final int[] TARGET_ADDRESS = { 120,121,122,123,124,125,126, + 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; + + public GroupAffiliationResponse( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.GROUP_AFFILIATION_RESPONSE.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + + sb.append( " AFFILIATION:" + getResponse().name() ); + sb.append( " ANNOUNCE GROUP:" + getAnnouncementGroupAddress() ); + sb.append( " GRP ADDR:" + getGroupAddress() ); + sb.append( " TGT ADDR: " + getTargetAddress() ); + + return sb.toString(); + } + + public String getAffiliationScope() + { + return mMessage.get( LOCAL_GLOBAL_AFFILIATION_FLAG) ? " GLOBAL" : " LOCAL"; + } + + public Response getResponse() + { + int response = mMessage.getInt( AFFILIATION_RESPONSE ); + + return Response.fromValue( response ); + } + + public String getAnnouncementGroupAddress() + { + return mMessage.getHex( ANNOUNCEMENT_GROUP_ADDRESS, 4 ); + } + + public String getGroupAddress() + { + return mMessage.getHex( GROUP_ADDRESS, 4 ); + } + + @Override + public String getFromID() + { + return getGroupAddress(); + } + + public String getTargetAddress() + { + return mMessage.getHex( TARGET_ADDRESS, 6 ); + } + + @Override + public String getToID() + { + return getTargetAddress(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/control/IdentifierUpdate.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdate.java similarity index 86% rename from src/module/decode/p25/message/tsbk/osp/control/IdentifierUpdate.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdate.java index d0b64617..672e19d0 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/IdentifierUpdate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdate.java @@ -1,83 +1,83 @@ -/******************************************************************************* - * 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 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 - * - ******************************************************************************/ -package module.decode.p25.message.tsbk.osp.control; - -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import alias.AliasList; -import bits.BinaryMessage; - -public abstract class IdentifierUpdate extends TSBKMessage implements IBandIdentifier -{ - public static final int[] IDENTIFIER = { 80,81,82,83 }; - - public static final int[] CHANNEL_SPACING = { 102,103,104,105,106,107,108, - 109,110,111 }; - - public static final int[] BASE_FREQUENCY = { 112,113,114,115,116,117,118, - 119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136, - 137,138,139,140,141,142,143 }; - - public IdentifierUpdate( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public int getIdentifier() - { - return mMessage.getInt( IDENTIFIER ); - } - - @Override - public long getChannelSpacing() - { - return mMessage.getLong( CHANNEL_SPACING ) * 125l; - } - - @Override - public long getBaseFrequency() - { - return mMessage.getLong( BASE_FREQUENCY ) * 5l; - } - - @Override - public abstract long getTransmitOffset(); - - @Override - public long getDownlinkFrequency(int channelNumber) - { - return getBaseFrequency() + ( channelNumber * getChannelSpacing() ); - } - - @Override - public long getUplinkFrequency(int channelNumber) - { - return getDownlinkFrequency(channelNumber) + getTransmitOffset(); - } - - @Override - public boolean isTDMA() - { - return false; - } -} +/******************************************************************************* + * 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 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 + * + ******************************************************************************/ +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; + +public abstract class IdentifierUpdate extends TSBKMessage implements IBandIdentifier +{ + public static final int[] IDENTIFIER = { 80,81,82,83 }; + + public static final int[] CHANNEL_SPACING = { 102,103,104,105,106,107,108, + 109,110,111 }; + + public static final int[] BASE_FREQUENCY = { 112,113,114,115,116,117,118, + 119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136, + 137,138,139,140,141,142,143 }; + + public IdentifierUpdate( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public int getIdentifier() + { + return mMessage.getInt( IDENTIFIER ); + } + + @Override + public long getChannelSpacing() + { + return mMessage.getLong( CHANNEL_SPACING ) * 125l; + } + + @Override + public long getBaseFrequency() + { + return mMessage.getLong( BASE_FREQUENCY ) * 5l; + } + + @Override + public abstract long getTransmitOffset(); + + @Override + public long getDownlinkFrequency(int channelNumber) + { + return getBaseFrequency() + ( channelNumber * getChannelSpacing() ); + } + + @Override + public long getUplinkFrequency(int channelNumber) + { + return getDownlinkFrequency(channelNumber) + getTransmitOffset(); + } + + @Override + public boolean isTDMA() + { + return false; + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateNonVUHF.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateNonVUHF.java similarity index 85% rename from src/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateNonVUHF.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateNonVUHF.java index 0022f082..4a5bd0ce 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateNonVUHF.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateNonVUHF.java @@ -1,77 +1,77 @@ -package module.decode.p25.message.tsbk.osp.control; - -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class IdentifierUpdateNonVUHF extends IdentifierUpdate -{ - public static final int[] BANDWIDTH = { 84,85,86,87,88,89,90,91,92 }; - - public static final int TRANSMIT_OFFSET_VHF_UHF_SIGN = 93; - - public static final int[] TRANSMIT_OFFSET = { 94,95,96,97,98,99,100,101 }; - - public IdentifierUpdateNonVUHF( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.IDENTIFIER_UPDATE_NON_VUHF.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - sb.append(toString()); - - return sb.toString(); - } - - public String toString() - { - StringBuilder sb = new StringBuilder(); - - sb.append( " ID:" + getIdentifier() ); - sb.append( " BASE:" + getBaseFrequency() ); - sb.append( " BANDWIDTH:" + getBandwidth() ); - sb.append( " SPACING:" + getChannelSpacing() ); - sb.append( " OFFSET:" + getTransmitOffset() ); - - return sb.toString(); - } - - /** - * Channel bandwidth in hertz - */ - public int getBandwidth() - { - return mMessage.getInt( BANDWIDTH ) * 125; - } - - /** - * Transmit offset in hertz - */ - @Override - public long getTransmitOffset() - { - long offset = mMessage.getLong( TRANSMIT_OFFSET ) * 250000l; - - if( mMessage.get( TRANSMIT_OFFSET_VHF_UHF_SIGN ) ) - { - return offset; - } - else - { - return -offset; - } - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class IdentifierUpdateNonVUHF extends IdentifierUpdate +{ + public static final int[] BANDWIDTH = { 84,85,86,87,88,89,90,91,92 }; + + public static final int TRANSMIT_OFFSET_VHF_UHF_SIGN = 93; + + public static final int[] TRANSMIT_OFFSET = { 94,95,96,97,98,99,100,101 }; + + public IdentifierUpdateNonVUHF( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.IDENTIFIER_UPDATE_NON_VUHF.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + sb.append(toString()); + + return sb.toString(); + } + + public String toString() + { + StringBuilder sb = new StringBuilder(); + + sb.append( " ID:" + getIdentifier() ); + sb.append( " BASE:" + getBaseFrequency() ); + sb.append( " BANDWIDTH:" + getBandwidth() ); + sb.append( " SPACING:" + getChannelSpacing() ); + sb.append( " OFFSET:" + getTransmitOffset() ); + + return sb.toString(); + } + + /** + * Channel bandwidth in hertz + */ + public int getBandwidth() + { + return mMessage.getInt( BANDWIDTH ) * 125; + } + + /** + * Transmit offset in hertz + */ + @Override + public long getTransmitOffset() + { + long offset = mMessage.getLong( TRANSMIT_OFFSET ) * 250000l; + + if( mMessage.get( TRANSMIT_OFFSET_VHF_UHF_SIGN ) ) + { + return offset; + } + else + { + return -offset; + } + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateTDMA.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateTDMA.java similarity index 91% rename from src/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateTDMA.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateTDMA.java index fc3b2d95..57eaf71e 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateTDMA.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateTDMA.java @@ -1,186 +1,186 @@ -package module.decode.p25.message.tsbk.osp.control; - -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class IdentifierUpdateTDMA extends IdentifierUpdate -{ - public static final int[] CHANNEL_TYPE = { 84,85,86,87 }; - public static final int TRANSMIT_OFFSET_SIGN = 88; - public static final int[] TRANSMIT_OFFSET = { 89,90,91,92,93,94,95,96,97,98, - 99,100,101 }; - - public IdentifierUpdateTDMA( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.IDENTIFIER_UPDATE_TDMA.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - sb.append(toString()); - - return sb.toString(); - } - - public String toString() - { - StringBuilder sb = new StringBuilder(); - - sb.append( " ID:" + getIdentifier() ); - sb.append( " BASE:" + getBaseFrequency() ); - sb.append( " BANDWIDTH:" + getBandwidth() ); - sb.append( " SPACING:" + getChannelSpacing() ); - sb.append( " OFFSET:" + getTransmitOffset() ); - sb.append( " TYPE:" + getChannelType().toString() ); - - return sb.toString(); - } - - public ChannelType getChannelType() - { - return ChannelType.fromValue( mMessage.getInt( CHANNEL_TYPE) ); - } - - /** - * Channel bandwidth in hertz - */ - public int getBandwidth() - { - return getChannelType().getBandwidth(); - } - - /** - * Transmit offset in hertz - */ - @Override - public long getTransmitOffset() - { - long offset = mMessage.getLong( TRANSMIT_OFFSET ) * - getChannelSpacing(); - - if( mMessage.get( TRANSMIT_OFFSET_SIGN ) ) - { - return offset; - } - else - { - return -offset; - } - } - - @Override - public long getDownlinkFrequency(int channelNumber) - { - if(isTDMA()) - { - return getBaseFrequency() + ( (channelNumber / getChannelType().getSlotsPerCarrier()) * getChannelSpacing() ); - } - else - { - return super.getDownlinkFrequency(channelNumber); - } - } - - @Override - public boolean isTDMA() - { - return getChannelType().getAccessType() == AccessType.TDMA; - } - - public enum ChannelType - { - TYPE_0( AccessType.FDMA, 12500, 1, Vocoder.HALF_RATE ), - TYPE_1( AccessType.FDMA, 12500, 1, Vocoder.FULL_RATE ), - TYPE_2( AccessType.FDMA, 6250, 1, Vocoder.HALF_RATE ), - TYPE_3( AccessType.TDMA, 12500, 2, Vocoder.HALF_RATE ), - TYPE_4( AccessType.TDMA, 25000, 4, Vocoder.HALF_RATE ), - TYPE_5( AccessType.TDMA, 12500, 2, Vocoder.HALF_RATE ), //HD8PSK simulcast - UNKNOWN( AccessType.UNKNOWN, 0, 0, Vocoder.HALF_RATE ); - - private AccessType mAccessType; - private int mBandwidth; - private int mSlotsPerCarrier; - private Vocoder mVocoder; - - private ChannelType( AccessType accessType, - int bandwidth, - int slots, - Vocoder vocoder ) - { - mAccessType = accessType; - mBandwidth = bandwidth; - mSlotsPerCarrier = slots; - mVocoder = vocoder; - } - - public String toString() - { - StringBuilder sb = new StringBuilder(); - - if( this.equals( TYPE_5 ) ) - { - sb.append("H-D8PSK SIMULCAST " ); - } - - sb.append( mAccessType.name() ); - sb.append( " BANDWIDTH:" + mBandwidth ); - sb.append( " TIMESLOTS PER CARRIER:" + mSlotsPerCarrier ); - sb.append( " VOCODER:" + mVocoder.name() ); - - return sb.toString(); - } - - public static ChannelType fromValue( int value ) - { - if( 0 <= value && value <= 5 ) - { - return ChannelType.values()[ value ]; - } - - return ChannelType.UNKNOWN; - } - - public AccessType getAccessType() - { - return mAccessType; - } - - public int getBandwidth() - { - return mBandwidth; - } - - public int getSlotsPerCarrier() - { - return mSlotsPerCarrier; - } - - public Vocoder getVocoder() - { - return mVocoder; - } - } - - public enum AccessType - { - FDMA,TDMA,UNKNOWN; - } - - public enum Vocoder - { - HALF_RATE, FULL_RATE; - } +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class IdentifierUpdateTDMA extends IdentifierUpdate +{ + public static final int[] CHANNEL_TYPE = { 84,85,86,87 }; + public static final int TRANSMIT_OFFSET_SIGN = 88; + public static final int[] TRANSMIT_OFFSET = { 89,90,91,92,93,94,95,96,97,98, + 99,100,101 }; + + public IdentifierUpdateTDMA( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.IDENTIFIER_UPDATE_TDMA.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + sb.append(toString()); + + return sb.toString(); + } + + public String toString() + { + StringBuilder sb = new StringBuilder(); + + sb.append( " ID:" + getIdentifier() ); + sb.append( " BASE:" + getBaseFrequency() ); + sb.append( " BANDWIDTH:" + getBandwidth() ); + sb.append( " SPACING:" + getChannelSpacing() ); + sb.append( " OFFSET:" + getTransmitOffset() ); + sb.append( " TYPE:" + getChannelType().toString() ); + + return sb.toString(); + } + + public ChannelType getChannelType() + { + return ChannelType.fromValue( mMessage.getInt( CHANNEL_TYPE) ); + } + + /** + * Channel bandwidth in hertz + */ + public int getBandwidth() + { + return getChannelType().getBandwidth(); + } + + /** + * Transmit offset in hertz + */ + @Override + public long getTransmitOffset() + { + long offset = mMessage.getLong( TRANSMIT_OFFSET ) * + getChannelSpacing(); + + if( mMessage.get( TRANSMIT_OFFSET_SIGN ) ) + { + return offset; + } + else + { + return -offset; + } + } + + @Override + public long getDownlinkFrequency(int channelNumber) + { + if(isTDMA()) + { + return getBaseFrequency() + ( (channelNumber / getChannelType().getSlotsPerCarrier()) * getChannelSpacing() ); + } + else + { + return super.getDownlinkFrequency(channelNumber); + } + } + + @Override + public boolean isTDMA() + { + return getChannelType().getAccessType() == AccessType.TDMA; + } + + public enum ChannelType + { + TYPE_0( AccessType.FDMA, 12500, 1, Vocoder.HALF_RATE ), + TYPE_1( AccessType.FDMA, 12500, 1, Vocoder.FULL_RATE ), + TYPE_2( AccessType.FDMA, 6250, 1, Vocoder.HALF_RATE ), + TYPE_3( AccessType.TDMA, 12500, 2, Vocoder.HALF_RATE ), + TYPE_4( AccessType.TDMA, 25000, 4, Vocoder.HALF_RATE ), + TYPE_5( AccessType.TDMA, 12500, 2, Vocoder.HALF_RATE ), //HD8PSK simulcast + UNKNOWN( AccessType.UNKNOWN, 0, 0, Vocoder.HALF_RATE ); + + private AccessType mAccessType; + private int mBandwidth; + private int mSlotsPerCarrier; + private Vocoder mVocoder; + + private ChannelType( AccessType accessType, + int bandwidth, + int slots, + Vocoder vocoder ) + { + mAccessType = accessType; + mBandwidth = bandwidth; + mSlotsPerCarrier = slots; + mVocoder = vocoder; + } + + public String toString() + { + StringBuilder sb = new StringBuilder(); + + if( this.equals( TYPE_5 ) ) + { + sb.append("H-D8PSK SIMULCAST " ); + } + + sb.append( mAccessType.name() ); + sb.append( " BANDWIDTH:" + mBandwidth ); + sb.append( " TIMESLOTS PER CARRIER:" + mSlotsPerCarrier ); + sb.append( " VOCODER:" + mVocoder.name() ); + + return sb.toString(); + } + + public static ChannelType fromValue( int value ) + { + if( 0 <= value && value <= 5 ) + { + return ChannelType.values()[ value ]; + } + + return ChannelType.UNKNOWN; + } + + public AccessType getAccessType() + { + return mAccessType; + } + + public int getBandwidth() + { + return mBandwidth; + } + + public int getSlotsPerCarrier() + { + return mSlotsPerCarrier; + } + + public Vocoder getVocoder() + { + return mVocoder; + } + } + + public enum AccessType + { + FDMA,TDMA,UNKNOWN; + } + + public enum Vocoder + { + HALF_RATE, FULL_RATE; + } } \ No newline at end of file diff --git a/src/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateVUHF.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateVUHF.java similarity index 87% rename from src/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateVUHF.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateVUHF.java index fb7c7098..bf8bb500 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateVUHF.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateVUHF.java @@ -1,89 +1,89 @@ -package module.decode.p25.message.tsbk.osp.control; - -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class IdentifierUpdateVUHF extends IdentifierUpdate -{ - public static final int[] BANDWIDTH = { 84,85,86,87 }; - - public static final int TRANSMIT_OFFSET_VHF_UHF_SIGN = 88; - - public static final int[] TRANSMIT_OFFSET = { 89,90,91,92,93,94,95,96,97,98, - 99,100,101 }; - - public IdentifierUpdateVUHF( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.IDENTIFIER_UPDATE_VHF_UHF_BANDS.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - sb.append(toString()); - - return sb.toString(); - } - - public String toString() - { - StringBuilder sb = new StringBuilder(); - - sb.append( " ID:" + getIdentifier() ); - sb.append( " BASE:" + getBaseFrequency() ); - sb.append( " BANDWIDTH:" + getBandwidth() ); - sb.append( " SPACING:" + getChannelSpacing() ); - sb.append( " OFFSET:" + getTransmitOffset() ); - - return sb.toString(); - } - - /** - * Channel bandwidth in hertz - */ - public int getBandwidth() - { - int bandwidth = mMessage.getInt( BANDWIDTH ); - - switch( bandwidth ) - { - case 4: - return 6250; - case 5: - return 12500; - default: - return 0; - } - } - - /** - * Transmit offset in hertz - */ - @Override - public long getTransmitOffset() - { - long offset = mMessage.getLong( TRANSMIT_OFFSET ) * - getChannelSpacing(); - - if( mMessage.get( TRANSMIT_OFFSET_VHF_UHF_SIGN ) ) - { - return offset; - } - else - { - return -offset; - } - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class IdentifierUpdateVUHF extends IdentifierUpdate +{ + public static final int[] BANDWIDTH = { 84,85,86,87 }; + + public static final int TRANSMIT_OFFSET_VHF_UHF_SIGN = 88; + + public static final int[] TRANSMIT_OFFSET = { 89,90,91,92,93,94,95,96,97,98, + 99,100,101 }; + + public IdentifierUpdateVUHF( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.IDENTIFIER_UPDATE_VHF_UHF_BANDS.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + sb.append(toString()); + + return sb.toString(); + } + + public String toString() + { + StringBuilder sb = new StringBuilder(); + + sb.append( " ID:" + getIdentifier() ); + sb.append( " BASE:" + getBaseFrequency() ); + sb.append( " BANDWIDTH:" + getBandwidth() ); + sb.append( " SPACING:" + getChannelSpacing() ); + sb.append( " OFFSET:" + getTransmitOffset() ); + + return sb.toString(); + } + + /** + * Channel bandwidth in hertz + */ + public int getBandwidth() + { + int bandwidth = mMessage.getInt( BANDWIDTH ); + + switch( bandwidth ) + { + case 4: + return 6250; + case 5: + return 12500; + default: + return 0; + } + } + + /** + * Transmit offset in hertz + */ + @Override + public long getTransmitOffset() + { + long offset = mMessage.getLong( TRANSMIT_OFFSET ) * + getChannelSpacing(); + + if( mMessage.get( TRANSMIT_OFFSET_VHF_UHF_SIGN ) ) + { + return offset; + } + else + { + return -offset; + } + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/control/LocationRegistrationResponse.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/LocationRegistrationResponse.java similarity index 82% rename from src/module/decode/p25/message/tsbk/osp/control/LocationRegistrationResponse.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/LocationRegistrationResponse.java index aa84caf6..9924e5b1 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/LocationRegistrationResponse.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/LocationRegistrationResponse.java @@ -1,78 +1,78 @@ -package module.decode.p25.message.tsbk.osp.control; - -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import module.decode.p25.reference.Response; -import alias.AliasList; -import bits.BinaryMessage; - -public class LocationRegistrationResponse extends TSBKMessage -{ - public static final int[] REGISTRATION_RESPONSE = { 86,87 }; - public static final int[] GROUP_ADDRESS = { 88,89,90,91,92,93,94,95,96,97, - 98,99,100,101,102,103 }; - public static final int[] RFSS_ID = { 104,105,106,107,108,109,110,111 }; - public static final int[] SITE_ID = { 112,113,114,115,116,117,118,119 }; - public static final int[] TARGET_ADDRESS = { 120,121,122,123,124,125,126, - 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; - - public LocationRegistrationResponse( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.LOCATION_REGISTRATION_RESPONSE.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - - sb.append( " REGISTRATION:" + getResponse().name() ); - sb.append( " GROUP:" + getGroupAddress() ); - sb.append( " RFSS: " + getRFSSID() ); - sb.append( " SITE: " + getSiteID() ); - sb.append( " TGT ADDR: " + getTargetAddress() ); - - return sb.toString(); - } - - public Response getResponse() - { - return Response.fromValue( mMessage.getInt( REGISTRATION_RESPONSE ) ); - } - - public String getGroupAddress() - { - return mMessage.getHex( GROUP_ADDRESS, 4 ); - } - - public String getRFSSID() - { - return mMessage.getHex( RFSS_ID, 2 ); - } - - public String getSiteID() - { - return mMessage.getHex( SITE_ID, 2 ); - } - - public String getTargetAddress() - { - return mMessage.getHex( TARGET_ADDRESS, 6 ); - } - - @Override - public String getToID() - { - return getTargetAddress(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; +import io.github.dsheirer.module.decode.p25.reference.Response; + +public class LocationRegistrationResponse extends TSBKMessage +{ + public static final int[] REGISTRATION_RESPONSE = { 86,87 }; + public static final int[] GROUP_ADDRESS = { 88,89,90,91,92,93,94,95,96,97, + 98,99,100,101,102,103 }; + public static final int[] RFSS_ID = { 104,105,106,107,108,109,110,111 }; + public static final int[] SITE_ID = { 112,113,114,115,116,117,118,119 }; + public static final int[] TARGET_ADDRESS = { 120,121,122,123,124,125,126, + 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; + + public LocationRegistrationResponse( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.LOCATION_REGISTRATION_RESPONSE.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + + sb.append( " REGISTRATION:" + getResponse().name() ); + sb.append( " GROUP:" + getGroupAddress() ); + sb.append( " RFSS: " + getRFSSID() ); + sb.append( " SITE: " + getSiteID() ); + sb.append( " TGT ADDR: " + getTargetAddress() ); + + return sb.toString(); + } + + public Response getResponse() + { + return Response.fromValue( mMessage.getInt( REGISTRATION_RESPONSE ) ); + } + + public String getGroupAddress() + { + return mMessage.getHex( GROUP_ADDRESS, 4 ); + } + + public String getRFSSID() + { + return mMessage.getHex( RFSS_ID, 2 ); + } + + public String getSiteID() + { + return mMessage.getHex( SITE_ID, 2 ); + } + + public String getTargetAddress() + { + return mMessage.getHex( TARGET_ADDRESS, 6 ); + } + + @Override + public String getToID() + { + return getTargetAddress(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/control/MessageUpdate.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/MessageUpdate.java similarity index 82% rename from src/module/decode/p25/message/tsbk/osp/control/MessageUpdate.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/MessageUpdate.java index c3a17372..497b5bd3 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/MessageUpdate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/MessageUpdate.java @@ -1,70 +1,70 @@ -package module.decode.p25.message.tsbk.osp.control; - -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class MessageUpdate extends TSBKMessage -{ - public static final int[] SHORT_DATA_MESSAGE = { 80,81,82,83,84,85,86,87,88,89,90,91, - 92,93,94,95 }; - public static final int[] TARGET_ADDRESS = { 96,97,98,99,100,101,102,103, - 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119 }; - public static final int[] SOURCE_ADDRESS = { 120,121,122,123,124,125,126, - 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; - - public MessageUpdate( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.MESSAGE_UPDATE.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - - sb.append( " MSG:" + getShortDataMessage() ); - sb.append( " SRC ADDR: " + getSourceAddress() ); - sb.append( " TGT ADDR: " + getTargetAddress() ); - - return sb.toString(); - } - - public String getShortDataMessage() - { - return mMessage.getHex( SHORT_DATA_MESSAGE, 4 ); - } - - public String getSourceAddress() - { - return mMessage.getHex( SOURCE_ADDRESS, 6 ); - } - - @Override - public String getFromID() - { - return getSourceAddress(); - } - - public String getTargetAddress() - { - return mMessage.getHex( TARGET_ADDRESS, 6 ); - } - - @Override - public String getToID() - { - return getTargetAddress(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class MessageUpdate extends TSBKMessage +{ + public static final int[] SHORT_DATA_MESSAGE = { 80,81,82,83,84,85,86,87,88,89,90,91, + 92,93,94,95 }; + public static final int[] TARGET_ADDRESS = { 96,97,98,99,100,101,102,103, + 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119 }; + public static final int[] SOURCE_ADDRESS = { 120,121,122,123,124,125,126, + 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; + + public MessageUpdate( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.MESSAGE_UPDATE.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + + sb.append( " MSG:" + getShortDataMessage() ); + sb.append( " SRC ADDR: " + getSourceAddress() ); + sb.append( " TGT ADDR: " + getTargetAddress() ); + + return sb.toString(); + } + + public String getShortDataMessage() + { + return mMessage.getHex( SHORT_DATA_MESSAGE, 4 ); + } + + public String getSourceAddress() + { + return mMessage.getHex( SOURCE_ADDRESS, 6 ); + } + + @Override + public String getFromID() + { + return getSourceAddress(); + } + + public String getTargetAddress() + { + return mMessage.getHex( TARGET_ADDRESS, 6 ); + } + + @Override + public String getToID() + { + return getTargetAddress(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/control/NetworkStatusBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/NetworkStatusBroadcast.java similarity index 87% rename from src/module/decode/p25/message/tsbk/osp/control/NetworkStatusBroadcast.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/NetworkStatusBroadcast.java index a911693e..c19510c3 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/NetworkStatusBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/NetworkStatusBroadcast.java @@ -1,147 +1,147 @@ -/******************************************************************************* - * 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 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 - * - ******************************************************************************/ -package module.decode.p25.message.tsbk.osp.control; - -import alias.AliasList; -import bits.BinaryMessage; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import module.decode.p25.reference.P25NetworkCallsign; - -public class NetworkStatusBroadcast extends TSBKMessage implements IdentifierReceiver -{ - public static final int[] LOCATION_REGISTRATION_AREA = {80, 81, 82, 83, 84, 85, 86, 87}; - public static final int[] WACN = {88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107}; - public static final int[] SYSTEM_ID = {108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119}; - public static final int[] IDENTIFIER = {120, 121, 122, 123}; - public static final int[] CHANNEL = {124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135}; - public static final int[] SYSTEM_SERVICE_CLASS = {136, 137, 138, 139, 140, 141, 142, 143}; - - private IBandIdentifier mIdentifierUpdate; - - public NetworkStatusBroadcast(BinaryMessage message, DataUnitID duid, AliasList aliasList) - { - super(message, duid, aliasList); - } - - @Override - public String getEventType() - { - return Opcode.NETWORK_STATUS_BROADCAST.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append(getMessageStub()); - - sb.append(" LRA:" + getLocationRegistrationArea()); - - sb.append(" WACN:" + getWACN()); - - sb.append(" SYS:" + getSystemID()); - - sb.append(" CTRL CHAN:" + getIdentifier() + "-" + getChannel()); - - sb.append(" DN:" + getDownlinkFrequency()); - - sb.append(" UP:" + getUplinkFrequency()); - - sb.append(" SYS SVC CLASS:" + - SystemService.toString(getSystemServiceClass())); - - return sb.toString(); - } - - public String getLocationRegistrationArea() - { - return mMessage.getHex(LOCATION_REGISTRATION_AREA, 2); - } - - public String getWACN() - { - return mMessage.getHex(WACN, 5); - } - - public String getSystemID() - { - return mMessage.getHex(SYSTEM_ID, 3); - } - - public String getNetworkCallsign() - { - return P25NetworkCallsign.getCallsign(mMessage.getInt(WACN), - mMessage.getInt(SYSTEM_ID)); - } - - public int getIdentifier() - { - return mMessage.getInt(IDENTIFIER); - } - - public int getChannel() - { - return mMessage.getInt(CHANNEL); - } - - public int getSystemServiceClass() - { - return mMessage.getInt(SYSTEM_SERVICE_CLASS); - } - - public long getDownlinkFrequency() - { - if(mIdentifierUpdate != null) - { - return mIdentifierUpdate.getDownlinkFrequency(getChannel()); - } - - return 0; - } - - public long getUplinkFrequency() - { - if(mIdentifierUpdate != null) - { - return mIdentifierUpdate.getUplinkFrequency(getChannel()); - } - - return 0; - } - - @Override - public void setIdentifierMessage(int identifier, IBandIdentifier message) - { - /* we're only expecting 1 identifier, so use whatever is received */ - mIdentifierUpdate = message; - } - - public int[] getIdentifiers() - { - int[] idens = new int[1]; - - idens[0] = getIdentifier(); - - return idens; - } -} +/******************************************************************************* + * 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 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 + * + ******************************************************************************/ +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; +import io.github.dsheirer.module.decode.p25.reference.P25NetworkCallsign; + +public class NetworkStatusBroadcast extends TSBKMessage implements IdentifierReceiver +{ + public static final int[] LOCATION_REGISTRATION_AREA = {80, 81, 82, 83, 84, 85, 86, 87}; + public static final int[] WACN = {88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107}; + public static final int[] SYSTEM_ID = {108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119}; + public static final int[] IDENTIFIER = {120, 121, 122, 123}; + public static final int[] CHANNEL = {124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135}; + public static final int[] SYSTEM_SERVICE_CLASS = {136, 137, 138, 139, 140, 141, 142, 143}; + + private IBandIdentifier mIdentifierUpdate; + + public NetworkStatusBroadcast(BinaryMessage message, DataUnitID duid, AliasList aliasList) + { + super(message, duid, aliasList); + } + + @Override + public String getEventType() + { + return Opcode.NETWORK_STATUS_BROADCAST.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append(getMessageStub()); + + sb.append(" LRA:" + getLocationRegistrationArea()); + + sb.append(" WACN:" + getWACN()); + + sb.append(" SYS:" + getSystemID()); + + sb.append(" CTRL CHAN:" + getIdentifier() + "-" + getChannel()); + + sb.append(" DN:" + getDownlinkFrequency()); + + sb.append(" UP:" + getUplinkFrequency()); + + sb.append(" SYS SVC CLASS:" + + SystemService.toString(getSystemServiceClass())); + + return sb.toString(); + } + + public String getLocationRegistrationArea() + { + return mMessage.getHex(LOCATION_REGISTRATION_AREA, 2); + } + + public String getWACN() + { + return mMessage.getHex(WACN, 5); + } + + public String getSystemID() + { + return mMessage.getHex(SYSTEM_ID, 3); + } + + public String getNetworkCallsign() + { + return P25NetworkCallsign.getCallsign(mMessage.getInt(WACN), + mMessage.getInt(SYSTEM_ID)); + } + + public int getIdentifier() + { + return mMessage.getInt(IDENTIFIER); + } + + public int getChannel() + { + return mMessage.getInt(CHANNEL); + } + + public int getSystemServiceClass() + { + return mMessage.getInt(SYSTEM_SERVICE_CLASS); + } + + public long getDownlinkFrequency() + { + if(mIdentifierUpdate != null) + { + return mIdentifierUpdate.getDownlinkFrequency(getChannel()); + } + + return 0; + } + + public long getUplinkFrequency() + { + if(mIdentifierUpdate != null) + { + return mIdentifierUpdate.getUplinkFrequency(getChannel()); + } + + return 0; + } + + @Override + public void setIdentifierMessage(int identifier, IBandIdentifier message) + { + /* we're only expecting 1 identifier, so use whatever is received */ + mIdentifierUpdate = message; + } + + public int[] getIdentifiers() + { + int[] idens = new int[1]; + + idens[0] = getIdentifier(); + + return idens; + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/control/ProtectionParameterUpdate.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/ProtectionParameterUpdate.java similarity index 78% rename from src/module/decode/p25/message/tsbk/osp/control/ProtectionParameterUpdate.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/ProtectionParameterUpdate.java index 38134ae3..9131f693 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/ProtectionParameterUpdate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/ProtectionParameterUpdate.java @@ -1,66 +1,66 @@ -package module.decode.p25.message.tsbk.osp.control; - -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Encryption; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class ProtectionParameterUpdate extends TSBKMessage -{ - public static final int[] ALGORITHM_ID = { 96,97,98,99,100,101,102,103 }; - public static final int[] KEY_ID = { 104,105,106,107,108,109,110,111,112, - 113,114,115,116,117,118,119 }; - public static final int[] TARGET_ADDRESS = { 120,121,122,123,124,125,126, - 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; - - public ProtectionParameterUpdate( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.PROTECTION_PARAMETER_UPDATE.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - - sb.append( " TGT ADDR: " + getTargetAddress() ); - - sb.append( " ENCRYPTION ALGORITHM:" + getAlgorithm().name() ); - - sb.append( " KEY:" + getKeyID() ); - - return sb.toString(); - } - - public Encryption getAlgorithm() - { - return Encryption.fromValue( mMessage.getInt( ALGORITHM_ID ) ); - } - - public String getKeyID() - { - return mMessage.getHex( KEY_ID, 4 ); - } - - public String getTargetAddress() - { - return mMessage.getHex( TARGET_ADDRESS, 6 ); - } - - @Override - public String getToID() - { - return getTargetAddress(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Encryption; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class ProtectionParameterUpdate extends TSBKMessage +{ + public static final int[] ALGORITHM_ID = { 96,97,98,99,100,101,102,103 }; + public static final int[] KEY_ID = { 104,105,106,107,108,109,110,111,112, + 113,114,115,116,117,118,119 }; + public static final int[] TARGET_ADDRESS = { 120,121,122,123,124,125,126, + 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; + + public ProtectionParameterUpdate( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.PROTECTION_PARAMETER_UPDATE.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + + sb.append( " TGT ADDR: " + getTargetAddress() ); + + sb.append( " ENCRYPTION ALGORITHM:" + getAlgorithm().name() ); + + sb.append( " KEY:" + getKeyID() ); + + return sb.toString(); + } + + public Encryption getAlgorithm() + { + return Encryption.fromValue( mMessage.getInt( ALGORITHM_ID ) ); + } + + public String getKeyID() + { + return mMessage.getHex( KEY_ID, 4 ); + } + + public String getTargetAddress() + { + return mMessage.getHex( TARGET_ADDRESS, 6 ); + } + + @Override + public String getToID() + { + return getTargetAddress(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/control/QueuedResponse.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/QueuedResponse.java similarity index 85% rename from src/module/decode/p25/message/tsbk/osp/control/QueuedResponse.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/QueuedResponse.java index 4a7de58b..932128df 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/QueuedResponse.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/QueuedResponse.java @@ -1,96 +1,96 @@ -package module.decode.p25.message.tsbk.osp.control; - -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import module.decode.p25.reference.QueuedResponseReason; -import alias.AliasList; -import bits.BinaryMessage; - -public class QueuedResponse extends TSBKMessage -{ - public static final int ADDITIONAL_INFORMATION_FLAG = 80; - public static final int[] SERVICE_TYPE = { 82,83,84,85,86,87 }; - public static final int[] REASON_CODE = { 88,89,90,91,92,93,94,95 }; - - public static final int[] CALL_OPTIONS = { 96,97,98,99,100,101,102,103 }; - public static final int[] SOURCE_GROUP = { 104,105,106,107,108,109,110,111 }; - public static final int[] SOURCE_ADDRESS = { 96,97,98,99,100,101,102,103,104, - 105,106,107,108,109,110,111 }; - - public static final int[] TARGET_ADDRESS = { 120,121,122,123,124,125,126, - 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; - - public QueuedResponse( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.QUEUED_RESPONSE.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - - sb.append( " TGT ADDR: " + getTargetAddress() ); - - sb.append( " REASON:" + getReason().name() ); - - return sb.toString(); - } - - public QueuedResponseReason getReason() - { - int code = mMessage.getInt( REASON_CODE ); - - return QueuedResponseReason.fromCode( code ); - } - - public boolean hasAdditionalInformation() - { - return mMessage.get( ADDITIONAL_INFORMATION_FLAG ); - } - - public Opcode getServiceType() - { - return Opcode.fromValue( mMessage.getInt( SERVICE_TYPE ) ); - } - - public String getSourceAddress() - { - switch( getServiceType() ) - { - case GROUP_DATA_CHANNEL_GRANT: - case GROUP_VOICE_CHANNEL_GRANT: - return mMessage.getHex( SOURCE_GROUP, 4 ); - case UNIT_TO_UNIT_VOICE_CHANNEL_GRANT: - case INDIVIDUAL_DATA_CHANNEL_GRANT: - return mMessage.getHex( SOURCE_ADDRESS, 6 ); - case TELEPHONE_INTERCONNECT_VOICE_CHANNEL_GRANT: - return "DELAY:" + ( mMessage.getInt( SOURCE_ADDRESS ) * 5 ) + "SECS"; - default: - break; - } - - return null; - } - - public String getTargetAddress() - { - return mMessage.getHex( TARGET_ADDRESS, 6 ); - } - - @Override - public String getToID() - { - return getTargetAddress(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; +import io.github.dsheirer.module.decode.p25.reference.QueuedResponseReason; + +public class QueuedResponse extends TSBKMessage +{ + public static final int ADDITIONAL_INFORMATION_FLAG = 80; + public static final int[] SERVICE_TYPE = { 82,83,84,85,86,87 }; + public static final int[] REASON_CODE = { 88,89,90,91,92,93,94,95 }; + + public static final int[] CALL_OPTIONS = { 96,97,98,99,100,101,102,103 }; + public static final int[] SOURCE_GROUP = { 104,105,106,107,108,109,110,111 }; + public static final int[] SOURCE_ADDRESS = { 96,97,98,99,100,101,102,103,104, + 105,106,107,108,109,110,111 }; + + public static final int[] TARGET_ADDRESS = { 120,121,122,123,124,125,126, + 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; + + public QueuedResponse( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.QUEUED_RESPONSE.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + + sb.append( " TGT ADDR: " + getTargetAddress() ); + + sb.append( " REASON:" + getReason().name() ); + + return sb.toString(); + } + + public QueuedResponseReason getReason() + { + int code = mMessage.getInt( REASON_CODE ); + + return QueuedResponseReason.fromCode( code ); + } + + public boolean hasAdditionalInformation() + { + return mMessage.get( ADDITIONAL_INFORMATION_FLAG ); + } + + public Opcode getServiceType() + { + return Opcode.fromValue( mMessage.getInt( SERVICE_TYPE ) ); + } + + public String getSourceAddress() + { + switch( getServiceType() ) + { + case GROUP_DATA_CHANNEL_GRANT: + case GROUP_VOICE_CHANNEL_GRANT: + return mMessage.getHex( SOURCE_GROUP, 4 ); + case UNIT_TO_UNIT_VOICE_CHANNEL_GRANT: + case INDIVIDUAL_DATA_CHANNEL_GRANT: + return mMessage.getHex( SOURCE_ADDRESS, 6 ); + case TELEPHONE_INTERCONNECT_VOICE_CHANNEL_GRANT: + return "DELAY:" + ( mMessage.getInt( SOURCE_ADDRESS ) * 5 ) + "SECS"; + default: + break; + } + + return null; + } + + public String getTargetAddress() + { + return mMessage.getHex( TARGET_ADDRESS, 6 ); + } + + @Override + public String getToID() + { + return getTargetAddress(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/control/RFSSStatusBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/RFSSStatusBroadcast.java similarity index 89% rename from src/module/decode/p25/message/tsbk/osp/control/RFSSStatusBroadcast.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/RFSSStatusBroadcast.java index 8e5ed2d3..a2a72d8a 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/RFSSStatusBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/RFSSStatusBroadcast.java @@ -1,158 +1,158 @@ -/******************************************************************************* - * 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 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 - * - ******************************************************************************/ -package module.decode.p25.message.tsbk.osp.control; - -import alias.AliasList; -import bits.BinaryMessage; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; - -public class RFSSStatusBroadcast extends TSBKMessage implements IdentifierReceiver -{ - public static final int[] LOCATION_REGISTRATION_AREA = {80, 81, 82, 83, 84, 85, 86, 87}; - public static final int ACTIVE_NETWORK_CONNECTION_FLAG = 91; - public static final int[] SYSTEM_ID = {92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103}; - public static final int[] RFSS_ID = {104, 105, 106, 107, 108, 109, 110, 111}; - public static final int[] SITE_ID = {112, 113, 114, 115, 116, 117, 118, 119}; - public static final int[] IDENTIFIER = {120, 121, 122, 123}; - public static final int[] CHANNEL = {124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135}; - public static final int[] SYSTEM_SERVICE_CLASS = {136, 137, 138, 139, 140, 141, 142, 143}; - - private IBandIdentifier mIdentifierUpdate; - - public RFSSStatusBroadcast(BinaryMessage message, DataUnitID duid, AliasList aliasList) - { - super(message, duid, aliasList); - } - - @Override - public String getEventType() - { - return Opcode.RFSS_STATUS_BROADCAST.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append(getMessageStub()); - - sb.append(" LRA:" + getLocationRegistrationArea()); - - sb.append(" SYSID:" + getSystemID()); - - sb.append(" RFSS:" + getRFSubsystemID()); - - sb.append(" SITE:" + getSiteID()); - - sb.append(" CHAN:" + getIdentifier() + "-" + getChannel()); - - sb.append(" DN:" + getDownlinkFrequency()); - - sb.append(" UP:" + getUplinkFrequency()); - - if(hasActiveNetworkConnection()) - { - sb.append(" ACTIVE-NETWORK-CONN"); - } - - sb.append(SystemService.toString(getSystemServiceClass())); - - return sb.toString(); - } - - public String getLocationRegistrationArea() - { - return mMessage.getHex(LOCATION_REGISTRATION_AREA, 2); - } - - public boolean hasActiveNetworkConnection() - { - return mMessage.get(ACTIVE_NETWORK_CONNECTION_FLAG); - } - - public String getSystemID() - { - return mMessage.getHex(SYSTEM_ID, 3); - } - - public String getRFSubsystemID() - { - return mMessage.getHex(RFSS_ID, 2); - } - - public String getSiteID() - { - return mMessage.getHex(SITE_ID, 2); - } - - public int getIdentifier() - { - return mMessage.getInt(IDENTIFIER); - } - - public int getChannel() - { - return mMessage.getInt(CHANNEL); - } - - public int getSystemServiceClass() - { - return mMessage.getInt(SYSTEM_SERVICE_CLASS); - } - - public long getDownlinkFrequency() - { - if(mIdentifierUpdate != null) - { - return mIdentifierUpdate.getDownlinkFrequency(getChannel()); - } - - return 0; - } - - public long getUplinkFrequency() - { - if(mIdentifierUpdate != null) - { - return mIdentifierUpdate.getUplinkFrequency(getChannel()); - } - - return 0; - } - - @Override - public void setIdentifierMessage(int identifier, IBandIdentifier message) - { - /* we're only expecting 1 identifier, so use whatever is received */ - mIdentifierUpdate = message; - } - - public int[] getIdentifiers() - { - int[] idens = new int[1]; - - idens[0] = getIdentifier(); - - return idens; - } -} +/******************************************************************************* + * 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 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 + * + ******************************************************************************/ +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class RFSSStatusBroadcast extends TSBKMessage implements IdentifierReceiver +{ + public static final int[] LOCATION_REGISTRATION_AREA = {80, 81, 82, 83, 84, 85, 86, 87}; + public static final int ACTIVE_NETWORK_CONNECTION_FLAG = 91; + public static final int[] SYSTEM_ID = {92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103}; + public static final int[] RFSS_ID = {104, 105, 106, 107, 108, 109, 110, 111}; + public static final int[] SITE_ID = {112, 113, 114, 115, 116, 117, 118, 119}; + public static final int[] IDENTIFIER = {120, 121, 122, 123}; + public static final int[] CHANNEL = {124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135}; + public static final int[] SYSTEM_SERVICE_CLASS = {136, 137, 138, 139, 140, 141, 142, 143}; + + private IBandIdentifier mIdentifierUpdate; + + public RFSSStatusBroadcast(BinaryMessage message, DataUnitID duid, AliasList aliasList) + { + super(message, duid, aliasList); + } + + @Override + public String getEventType() + { + return Opcode.RFSS_STATUS_BROADCAST.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append(getMessageStub()); + + sb.append(" LRA:" + getLocationRegistrationArea()); + + sb.append(" SYSID:" + getSystemID()); + + sb.append(" RFSS:" + getRFSubsystemID()); + + sb.append(" SITE:" + getSiteID()); + + sb.append(" CHAN:" + getIdentifier() + "-" + getChannel()); + + sb.append(" DN:" + getDownlinkFrequency()); + + sb.append(" UP:" + getUplinkFrequency()); + + if(hasActiveNetworkConnection()) + { + sb.append(" ACTIVE-NETWORK-CONN"); + } + + sb.append(SystemService.toString(getSystemServiceClass())); + + return sb.toString(); + } + + public String getLocationRegistrationArea() + { + return mMessage.getHex(LOCATION_REGISTRATION_AREA, 2); + } + + public boolean hasActiveNetworkConnection() + { + return mMessage.get(ACTIVE_NETWORK_CONNECTION_FLAG); + } + + public String getSystemID() + { + return mMessage.getHex(SYSTEM_ID, 3); + } + + public String getRFSubsystemID() + { + return mMessage.getHex(RFSS_ID, 2); + } + + public String getSiteID() + { + return mMessage.getHex(SITE_ID, 2); + } + + public int getIdentifier() + { + return mMessage.getInt(IDENTIFIER); + } + + public int getChannel() + { + return mMessage.getInt(CHANNEL); + } + + public int getSystemServiceClass() + { + return mMessage.getInt(SYSTEM_SERVICE_CLASS); + } + + public long getDownlinkFrequency() + { + if(mIdentifierUpdate != null) + { + return mIdentifierUpdate.getDownlinkFrequency(getChannel()); + } + + return 0; + } + + public long getUplinkFrequency() + { + if(mIdentifierUpdate != null) + { + return mIdentifierUpdate.getUplinkFrequency(getChannel()); + } + + return 0; + } + + @Override + public void setIdentifierMessage(int identifier, IBandIdentifier message) + { + /* we're only expecting 1 identifier, so use whatever is received */ + mIdentifierUpdate = message; + } + + public int[] getIdentifiers() + { + int[] idens = new int[1]; + + idens[0] = getIdentifier(); + + return idens; + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/control/RadioUnitMonitorCommand.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/RadioUnitMonitorCommand.java similarity index 82% rename from src/module/decode/p25/message/tsbk/osp/control/RadioUnitMonitorCommand.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/RadioUnitMonitorCommand.java index e4df302e..9a54d794 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/RadioUnitMonitorCommand.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/RadioUnitMonitorCommand.java @@ -1,69 +1,69 @@ -package module.decode.p25.message.tsbk.osp.control; - -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class RadioUnitMonitorCommand extends TSBKMessage -{ - public static final int[] TX_MULTIPLIER = { 94,95 }; - public static final int[] SOURCE_ADDRESS = { 96,97,98,99,100,101,102,103, - 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119 }; - public static final int[] TARGET_ADDRESS = { 120,121,122,123,124,125,126, - 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; - - public RadioUnitMonitorCommand( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.RADIO_UNIT_MONITOR_COMMAND.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - - sb.append( " MULT:" + getTransmitMultiplier() ); - sb.append( " SRC ADDR: " + getSourceAddress() ); - sb.append( " TGT ADDR: " + getTargetAddress() ); - - return sb.toString(); - } - - public int getTransmitMultiplier() - { - return mMessage.getInt( TX_MULTIPLIER ); - } - - public String getSourceAddress() - { - return mMessage.getHex( SOURCE_ADDRESS, 6 ); - } - - @Override - public String getFromID() - { - return getSourceAddress(); - } - - public String getTargetAddress() - { - return mMessage.getHex( TARGET_ADDRESS, 6 ); - } - - @Override - public String getToID() - { - return getTargetAddress(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class RadioUnitMonitorCommand extends TSBKMessage +{ + public static final int[] TX_MULTIPLIER = { 94,95 }; + public static final int[] SOURCE_ADDRESS = { 96,97,98,99,100,101,102,103, + 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119 }; + public static final int[] TARGET_ADDRESS = { 120,121,122,123,124,125,126, + 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; + + public RadioUnitMonitorCommand( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.RADIO_UNIT_MONITOR_COMMAND.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + + sb.append( " MULT:" + getTransmitMultiplier() ); + sb.append( " SRC ADDR: " + getSourceAddress() ); + sb.append( " TGT ADDR: " + getTargetAddress() ); + + return sb.toString(); + } + + public int getTransmitMultiplier() + { + return mMessage.getInt( TX_MULTIPLIER ); + } + + public String getSourceAddress() + { + return mMessage.getHex( SOURCE_ADDRESS, 6 ); + } + + @Override + public String getFromID() + { + return getSourceAddress(); + } + + public String getTargetAddress() + { + return mMessage.getHex( TARGET_ADDRESS, 6 ); + } + + @Override + public String getToID() + { + return getTargetAddress(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/control/RoamingAddressCommand.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/RoamingAddressCommand.java similarity index 80% rename from src/module/decode/p25/message/tsbk/osp/control/RoamingAddressCommand.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/RoamingAddressCommand.java index f1b19911..3a9f9545 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/RoamingAddressCommand.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/RoamingAddressCommand.java @@ -1,72 +1,72 @@ -package module.decode.p25.message.tsbk.osp.control; - -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import module.decode.p25.reference.StackOperation; -import alias.AliasList; -import bits.BinaryMessage; - -public class RoamingAddressCommand extends TSBKMessage -{ - public static final int[] STACK_OPERATION = { 80,81,82,83,84,85,86,87 }; - public static final int[] WACN = { 88,89,90,91,92,93,94,95,96,97,98,99,100, - 101,102,103,104,105,106,107 }; - public static final int[] SYSTEM_ID = { 108,109,110,111,112,113,114,115,116, - 117,118,119 }; - public static final int[] TARGET_ID = { 120,121,122,123,124,125,126,127,128, - 129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; - - public RoamingAddressCommand( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.ROAMING_ADDRESS_COMMAND.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - - sb.append( getStackOperation().name() ); - sb.append( " WACN:" + getWACN() ); - sb.append( " SYSTEM: " + getSystemID() ); - sb.append( " TGT ID: " + getTargetID() ); - - return sb.toString(); - } - - public StackOperation getStackOperation() - { - return StackOperation.fromValue( mMessage.getInt( STACK_OPERATION ) ); - } - - public String getWACN() - { - return mMessage.getHex( WACN, 5 ); - } - - public String getSystemID() - { - return mMessage.getHex( SYSTEM_ID, 3 ); - } - - public String getTargetID() - { - return mMessage.getHex( TARGET_ID, 6 ); - } - - @Override - public String getToID() - { - return getTargetID(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; +import io.github.dsheirer.module.decode.p25.reference.StackOperation; + +public class RoamingAddressCommand extends TSBKMessage +{ + public static final int[] STACK_OPERATION = { 80,81,82,83,84,85,86,87 }; + public static final int[] WACN = { 88,89,90,91,92,93,94,95,96,97,98,99,100, + 101,102,103,104,105,106,107 }; + public static final int[] SYSTEM_ID = { 108,109,110,111,112,113,114,115,116, + 117,118,119 }; + public static final int[] TARGET_ID = { 120,121,122,123,124,125,126,127,128, + 129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; + + public RoamingAddressCommand( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.ROAMING_ADDRESS_COMMAND.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + + sb.append( getStackOperation().name() ); + sb.append( " WACN:" + getWACN() ); + sb.append( " SYSTEM: " + getSystemID() ); + sb.append( " TGT ID: " + getTargetID() ); + + return sb.toString(); + } + + public StackOperation getStackOperation() + { + return StackOperation.fromValue( mMessage.getInt( STACK_OPERATION ) ); + } + + public String getWACN() + { + return mMessage.getHex( WACN, 5 ); + } + + public String getSystemID() + { + return mMessage.getHex( SYSTEM_ID, 3 ); + } + + public String getTargetID() + { + return mMessage.getHex( TARGET_ID, 6 ); + } + + @Override + public String getToID() + { + return getTargetID(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/control/SecondaryControlChannelBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SecondaryControlChannelBroadcast.java similarity index 91% rename from src/module/decode/p25/message/tsbk/osp/control/SecondaryControlChannelBroadcast.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SecondaryControlChannelBroadcast.java index e120c785..15461a76 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/SecondaryControlChannelBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SecondaryControlChannelBroadcast.java @@ -1,266 +1,266 @@ -/******************************************************************************* - * 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 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 - * - ******************************************************************************/ -package module.decode.p25.message.tsbk.osp.control; - -import alias.AliasList; -import bits.BinaryMessage; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; - -public class SecondaryControlChannelBroadcast extends TSBKMessage implements IdentifierReceiver, Comparable -{ - public static final int[] RFSS_ID = {80, 81, 82, 83, 84, 85, 86, 87}; - public static final int[] SITE_ID = {88, 89, 90, 91, 92, 93, 94, 95}; - public static final int[] IDENTIFIER_1 = {96, 97, 98, 99}; - public static final int[] CHANNEL_1 = {100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111}; - public static final int[] SYSTEM_SERVICE_CLASS_1 = {112, 113, 114, 115, 116, 117, 118, 119}; - public static final int[] IDENTIFIER_2 = {120, 121, 122, 123}; - public static final int[] CHANNEL_2 = {124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135}; - public static final int[] SYSTEM_SERVICE_CLASS_2 = {136, 137, 138, 139, 140, 141, 142, 143}; - - private IBandIdentifier mIdentifierUpdate1; - private IBandIdentifier mIdentifierUpdate2; - - public SecondaryControlChannelBroadcast(BinaryMessage message, - DataUnitID duid, - AliasList aliasList) - { - super(message, duid, aliasList); - } - - @Override - public String getEventType() - { - return Opcode.SECONDARY_CONTROL_CHANNEL_BROADCAST.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append(getMessageStub()); - - sb.append(" SITE:" + getRFSS() + "-" + getSiteID()); - - sb.append(" CHAN1:" + getIdentifier1() + "-" + getChannel1()); - - sb.append(" DN1:" + getDownlinkFrequency1()); - - sb.append(" UP1:" + getUplinkFrequency1()); - - sb.append(" SVC1:" + SystemService.toString(getSystemServiceClass1())); - - if(hasChannel2()) - { - sb.append(" CHAN2:" + getIdentifier2() + "-" + getChannel2()); - - sb.append(" DN2:" + getDownlinkFrequency2()); - - sb.append(" UP2:" + getUplinkFrequency2()); - - sb.append(" SVC2:" + SystemService.toString(getSystemServiceClass2())); - } - - return sb.toString(); - } - - public String getRFSS() - { - return mMessage.getHex(RFSS_ID, 2); - } - - public String getSiteID() - { - return mMessage.getHex(SITE_ID, 2); - } - - public int getIdentifier1() - { - return mMessage.getInt(IDENTIFIER_1); - } - - public int getChannel1() - { - return mMessage.getInt(CHANNEL_1); - } - - public int getSystemServiceClass1() - { - return mMessage.getInt(SYSTEM_SERVICE_CLASS_1); - } - - public int getIdentifier2() - { - return mMessage.getInt(IDENTIFIER_2); - } - - public int getChannel2() - { - return mMessage.getInt(CHANNEL_2); - } - - public int getSystemServiceClass2() - { - return mMessage.getInt(SYSTEM_SERVICE_CLASS_2); - } - - public boolean hasChannel2() - { - return getSystemServiceClass2() != 0; - } - - - public long getDownlinkFrequency1() - { - if(mIdentifierUpdate1 != null) - { - return mIdentifierUpdate1.getDownlinkFrequency(getChannel1()); - } - - return 0; - } - - public long getUplinkFrequency1() - { - if(mIdentifierUpdate1 != null) - { - return mIdentifierUpdate1.getUplinkFrequency(getChannel1()); - } - - return 0; - } - - public long getDownlinkFrequency2() - { - if(mIdentifierUpdate2 != null) - { - return mIdentifierUpdate2.getDownlinkFrequency(getChannel2()); - } - - return 0; - } - - public long getUplinkFrequency2() - { - if(mIdentifierUpdate2 != null) - { - return mIdentifierUpdate2.getUplinkFrequency(getChannel2()); - } - - return 0; - } - - @Override - public void setIdentifierMessage(int identifier, IBandIdentifier message) - { - if(identifier == getIdentifier1()) - { - mIdentifierUpdate1 = message; - } - - if(identifier == getIdentifier2()) - { - mIdentifierUpdate2 = message; - } - } - - public int[] getIdentifiers() - { - int[] idens; - - if(hasChannel2()) - { - idens = new int[2]; - - idens[0] = getIdentifier1(); - idens[1] = getIdentifier2(); - } - else - { - idens = new int[1]; - - idens[0] = getIdentifier1(); - } - - return idens; - } - - @Override - public int compareTo(SecondaryControlChannelBroadcast other) - { - if(other.getRFSS().contentEquals(getRFSS()) && - other.getSiteID().contentEquals(getSiteID()) && - other.getIdentifier1() == getIdentifier1() && - other.getChannel1() == getChannel1()) - { - return 0; - } - else if(other.getIdentifier1() < getIdentifier1()) - { - return -1; - } - else - { - return 1; - } - } - - @Override - public boolean equals(Object o) - { - if(this == o) - { - return true; - } - if(!(o instanceof SecondaryControlChannelBroadcast)) - { - return false; - } - - SecondaryControlChannelBroadcast that = (SecondaryControlChannelBroadcast)o; - - if(getRFSS() != that.getRFSS()) - { - return false; - } - if(getSiteID() != that.getSiteID()) - { - return false; - } - if(getIdentifier1() != that.getIdentifier1()) - { - return false; - } - - return getChannel1() == that.getChannel1(); - } - - @Override - public int hashCode() - { - int result = getRFSS() != null ? getRFSS().hashCode() : 0; - result = 31 * result + getSiteID() != null ? getSiteID().hashCode() : 0; - result = 31 * result + getIdentifier1(); - result = 31 * result + getChannel1(); - return result; - } -} +/******************************************************************************* + * 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 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 + * + ******************************************************************************/ +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class SecondaryControlChannelBroadcast extends TSBKMessage implements IdentifierReceiver, Comparable +{ + public static final int[] RFSS_ID = {80, 81, 82, 83, 84, 85, 86, 87}; + public static final int[] SITE_ID = {88, 89, 90, 91, 92, 93, 94, 95}; + public static final int[] IDENTIFIER_1 = {96, 97, 98, 99}; + public static final int[] CHANNEL_1 = {100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111}; + public static final int[] SYSTEM_SERVICE_CLASS_1 = {112, 113, 114, 115, 116, 117, 118, 119}; + public static final int[] IDENTIFIER_2 = {120, 121, 122, 123}; + public static final int[] CHANNEL_2 = {124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135}; + public static final int[] SYSTEM_SERVICE_CLASS_2 = {136, 137, 138, 139, 140, 141, 142, 143}; + + private IBandIdentifier mIdentifierUpdate1; + private IBandIdentifier mIdentifierUpdate2; + + public SecondaryControlChannelBroadcast(BinaryMessage message, + DataUnitID duid, + AliasList aliasList) + { + super(message, duid, aliasList); + } + + @Override + public String getEventType() + { + return Opcode.SECONDARY_CONTROL_CHANNEL_BROADCAST.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append(getMessageStub()); + + sb.append(" SITE:" + getRFSS() + "-" + getSiteID()); + + sb.append(" CHAN1:" + getIdentifier1() + "-" + getChannel1()); + + sb.append(" DN1:" + getDownlinkFrequency1()); + + sb.append(" UP1:" + getUplinkFrequency1()); + + sb.append(" SVC1:" + SystemService.toString(getSystemServiceClass1())); + + if(hasChannel2()) + { + sb.append(" CHAN2:" + getIdentifier2() + "-" + getChannel2()); + + sb.append(" DN2:" + getDownlinkFrequency2()); + + sb.append(" UP2:" + getUplinkFrequency2()); + + sb.append(" SVC2:" + SystemService.toString(getSystemServiceClass2())); + } + + return sb.toString(); + } + + public String getRFSS() + { + return mMessage.getHex(RFSS_ID, 2); + } + + public String getSiteID() + { + return mMessage.getHex(SITE_ID, 2); + } + + public int getIdentifier1() + { + return mMessage.getInt(IDENTIFIER_1); + } + + public int getChannel1() + { + return mMessage.getInt(CHANNEL_1); + } + + public int getSystemServiceClass1() + { + return mMessage.getInt(SYSTEM_SERVICE_CLASS_1); + } + + public int getIdentifier2() + { + return mMessage.getInt(IDENTIFIER_2); + } + + public int getChannel2() + { + return mMessage.getInt(CHANNEL_2); + } + + public int getSystemServiceClass2() + { + return mMessage.getInt(SYSTEM_SERVICE_CLASS_2); + } + + public boolean hasChannel2() + { + return getSystemServiceClass2() != 0; + } + + + public long getDownlinkFrequency1() + { + if(mIdentifierUpdate1 != null) + { + return mIdentifierUpdate1.getDownlinkFrequency(getChannel1()); + } + + return 0; + } + + public long getUplinkFrequency1() + { + if(mIdentifierUpdate1 != null) + { + return mIdentifierUpdate1.getUplinkFrequency(getChannel1()); + } + + return 0; + } + + public long getDownlinkFrequency2() + { + if(mIdentifierUpdate2 != null) + { + return mIdentifierUpdate2.getDownlinkFrequency(getChannel2()); + } + + return 0; + } + + public long getUplinkFrequency2() + { + if(mIdentifierUpdate2 != null) + { + return mIdentifierUpdate2.getUplinkFrequency(getChannel2()); + } + + return 0; + } + + @Override + public void setIdentifierMessage(int identifier, IBandIdentifier message) + { + if(identifier == getIdentifier1()) + { + mIdentifierUpdate1 = message; + } + + if(identifier == getIdentifier2()) + { + mIdentifierUpdate2 = message; + } + } + + public int[] getIdentifiers() + { + int[] idens; + + if(hasChannel2()) + { + idens = new int[2]; + + idens[0] = getIdentifier1(); + idens[1] = getIdentifier2(); + } + else + { + idens = new int[1]; + + idens[0] = getIdentifier1(); + } + + return idens; + } + + @Override + public int compareTo(SecondaryControlChannelBroadcast other) + { + if(other.getRFSS().contentEquals(getRFSS()) && + other.getSiteID().contentEquals(getSiteID()) && + other.getIdentifier1() == getIdentifier1() && + other.getChannel1() == getChannel1()) + { + return 0; + } + else if(other.getIdentifier1() < getIdentifier1()) + { + return -1; + } + else + { + return 1; + } + } + + @Override + public boolean equals(Object o) + { + if(this == o) + { + return true; + } + if(!(o instanceof SecondaryControlChannelBroadcast)) + { + return false; + } + + SecondaryControlChannelBroadcast that = (SecondaryControlChannelBroadcast)o; + + if(getRFSS() != that.getRFSS()) + { + return false; + } + if(getSiteID() != that.getSiteID()) + { + return false; + } + if(getIdentifier1() != that.getIdentifier1()) + { + return false; + } + + return getChannel1() == that.getChannel1(); + } + + @Override + public int hashCode() + { + int result = getRFSS() != null ? getRFSS().hashCode() : 0; + result = 31 * result + getSiteID() != null ? getSiteID().hashCode() : 0; + result = 31 * result + getIdentifier1(); + result = 31 * result + getChannel1(); + return result; + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/control/SecondaryControlChannelBroadcastExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SecondaryControlChannelBroadcastExplicit.java similarity index 82% rename from src/module/decode/p25/message/tsbk/osp/control/SecondaryControlChannelBroadcastExplicit.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SecondaryControlChannelBroadcastExplicit.java index e918901f..a8be1880 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/SecondaryControlChannelBroadcastExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SecondaryControlChannelBroadcastExplicit.java @@ -1,14 +1,12 @@ -package module.decode.p25.message.tsbk.osp.control; - -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import alias.AliasList; -import bits.BinaryMessage; - public class SecondaryControlChannelBroadcastExplicit extends SecondaryControlChannelBroadcast { diff --git a/src/module/decode/p25/message/tsbk/osp/control/StatusQuery.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/StatusQuery.java similarity index 79% rename from src/module/decode/p25/message/tsbk/osp/control/StatusQuery.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/StatusQuery.java index 8d856dbc..8986c317 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/StatusQuery.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/StatusQuery.java @@ -1,62 +1,62 @@ -package module.decode.p25.message.tsbk.osp.control; - -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class StatusQuery extends TSBKMessage -{ - public static final int[] TARGET_ADDRESS = { 96,97,98,99,100,101,102,103, - 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119 }; - public static final int[] SOURCE_ADDRESS = { 120,121,122,123,124,125,126, - 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; - - public StatusQuery( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.STATUS_QUERY.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - - sb.append( " SRC ADDR: " + getSourceAddress() ); - sb.append( " TGT ADDR: " + getTargetAddress() ); - - return sb.toString(); - } - - public String getSourceAddress() - { - return mMessage.getHex( SOURCE_ADDRESS, 6 ); - } - - @Override - public String getFromID() - { - return getSourceAddress(); - } - - public String getTargetAddress() - { - return mMessage.getHex( TARGET_ADDRESS, 6 ); - } - - @Override - public String getToID() - { - return getTargetAddress(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class StatusQuery extends TSBKMessage +{ + public static final int[] TARGET_ADDRESS = { 96,97,98,99,100,101,102,103, + 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119 }; + public static final int[] SOURCE_ADDRESS = { 120,121,122,123,124,125,126, + 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; + + public StatusQuery( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.STATUS_QUERY.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + + sb.append( " SRC ADDR: " + getSourceAddress() ); + sb.append( " TGT ADDR: " + getTargetAddress() ); + + return sb.toString(); + } + + public String getSourceAddress() + { + return mMessage.getHex( SOURCE_ADDRESS, 6 ); + } + + @Override + public String getFromID() + { + return getSourceAddress(); + } + + public String getTargetAddress() + { + return mMessage.getHex( TARGET_ADDRESS, 6 ); + } + + @Override + public String getToID() + { + return getTargetAddress(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/control/StatusUpdate.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/StatusUpdate.java similarity index 83% rename from src/module/decode/p25/message/tsbk/osp/control/StatusUpdate.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/StatusUpdate.java index 59290a61..370c7874 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/StatusUpdate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/StatusUpdate.java @@ -1,76 +1,76 @@ -package module.decode.p25.message.tsbk.osp.control; - -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class StatusUpdate extends TSBKMessage -{ - public static final int[] USER_STATUS = { 72,73,74,75,88,89,90,91 }; - public static final int[] UNIT_STATUS = { 92,93,94,95,96,97,98,99 }; - public static final int[] TARGET_ADDRESS = { 112,113,114,115,116,117,118, - 119,120,121,122,123,136,137,138,139,140,141,142,143,144,145,146,147 }; - public static final int[] SOURCE_ADDRESS = { 160,161,162,163,164,165,166, - 167,168,169,170,171,184,185,186,187,188,189,190,190,192,193,194,195 }; - - public StatusUpdate( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.STATUS_UPDATE.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - - sb.append( " STATUS USER:" + getUserStatus() ); - sb.append( " UNIT:" + getUnitStatus() ); - sb.append( " SRC ADDR: " + getSourceAddress() ); - sb.append( " TGT ADDR: " + getTargetAddress() ); - - return sb.toString(); - } - - public String getUserStatus() - { - return mMessage.getHex( USER_STATUS, 2 ); - } - - public String getUnitStatus() - { - return mMessage.getHex( UNIT_STATUS, 2 ); - } - - public String getSourceAddress() - { - return mMessage.getHex( SOURCE_ADDRESS, 6 ); - } - - @Override - public String getFromID() - { - return getSourceAddress(); - } - - public String getTargetAddress() - { - return mMessage.getHex( TARGET_ADDRESS, 6 ); - } - - @Override - public String getToID() - { - return getTargetAddress(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class StatusUpdate extends TSBKMessage +{ + public static final int[] USER_STATUS = { 72,73,74,75,88,89,90,91 }; + public static final int[] UNIT_STATUS = { 92,93,94,95,96,97,98,99 }; + public static final int[] TARGET_ADDRESS = { 112,113,114,115,116,117,118, + 119,120,121,122,123,136,137,138,139,140,141,142,143,144,145,146,147 }; + public static final int[] SOURCE_ADDRESS = { 160,161,162,163,164,165,166, + 167,168,169,170,171,184,185,186,187,188,189,190,190,192,193,194,195 }; + + public StatusUpdate( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.STATUS_UPDATE.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + + sb.append( " STATUS USER:" + getUserStatus() ); + sb.append( " UNIT:" + getUnitStatus() ); + sb.append( " SRC ADDR: " + getSourceAddress() ); + sb.append( " TGT ADDR: " + getTargetAddress() ); + + return sb.toString(); + } + + public String getUserStatus() + { + return mMessage.getHex( USER_STATUS, 2 ); + } + + public String getUnitStatus() + { + return mMessage.getHex( UNIT_STATUS, 2 ); + } + + public String getSourceAddress() + { + return mMessage.getHex( SOURCE_ADDRESS, 6 ); + } + + @Override + public String getFromID() + { + return getSourceAddress(); + } + + public String getTargetAddress() + { + return mMessage.getHex( TARGET_ADDRESS, 6 ); + } + + @Override + public String getToID() + { + return getTargetAddress(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/control/SyncBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SyncBroadcast.java similarity index 93% rename from src/module/decode/p25/message/tsbk/osp/control/SyncBroadcast.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SyncBroadcast.java index ecb9d25e..2f8f1988 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/SyncBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SyncBroadcast.java @@ -1,274 +1,274 @@ -package module.decode.p25.message.tsbk.osp.control; - -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.SimpleTimeZone; -import java.util.TimeZone; - -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -/** - * Sync Broadcast - used to broadcast FDMA-TDMA timing synchronization - * information so that a subscriber unit that is time synchronized on an FDMA - * control channel is also time synchronized with all TDMA traffic channels at - * the site. - */ -public class SyncBroadcast extends TSBKMessage -{ - public static final int[] RESERVED = { 80,81,82,83,84,85,86,87,88,89,90,91,92 }; - public static final int SYSTEM_TIME_NOT_LOCKED_TO_EXTERNAL_REFERENCE = 93; - public static final int MICRO_SLOTS_TO_MINUTE_ROLLOVER_UNLOCKED = 94; - public static final int[] LEAP_SECOND_CORRECTION = { 95,96 }; - public static final int LOCAL_TIME_OFFSET_VALID = 97; - public static final int LOCAL_TIME_OFFSET_SIGN = 98; - public static final int[] LOCAL_TIME_OFFSET_HOURS = { 99,100,101,102 }; - public static final int LOCAL_TIME_OFFSET_HALF_HOUR = 103; - - public static final int[] YEAR = { 104,105,106,107,108,109,110 }; - public static final int[] MONTH = { 111,112,113,114 }; - public static final int[] DAY = { 115,116,117,118,119 }; - public static final int[] HOURS = { 120,121,122,123,124 }; - public static final int[] MINUTES = { 125,126,127,128,129,130 }; - public static final int[] MICRO_SLOTS = { 131,132,133,134,135,136,137,138, - 139,140,141,142,143 }; - public static final int[] TSBK_CRC = { 144,145,146,147,148,149,150,151,152, - 153,154,155,156,157,158,159 }; - - private static final DateFormat TIME_FORMATTER = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss.SSS Z" ); - private static final TimeZone NO_TIME_ZONE = new SimpleTimeZone( 0, "NONE" ); - - public SyncBroadcast( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.TDMA_SYNC_BROADCAST.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - - sb.append( " SYSTEM TIME" ); - - if( isSystemTimeNotLockedToExternalReference() ) - { - sb.append( " UNLOCKED" ); - } - - sb.append( ":" ); - - TIME_FORMATTER.setTimeZone( getTimeZone() ); - sb.append( " " + TIME_FORMATTER.format( new Date( getSystemTime() ) ) ); - - sb.append( " LEAP-SECOND CORRECTION:" + getLeapSecondCorrection() + "mS" ); - - if( isMicroslotsLockedToMinuteRollover() ) - { - sb.append( " MICROSLOT-MINUTE ROLLOVER:LOCKED" ); - } - else - { - sb.append( " MICROSLOT-MINUTE ROLLOVER:UNLOCKED" ); - } - - return sb.toString(); - } - - /** - * System Time (UTC) in milliseconds since java epoch - */ - public long getSystemTime() - { - Calendar cal = Calendar.getInstance( TimeZone.getTimeZone( "UTC" ) ); - - cal.clear(); - - cal.set( Calendar.YEAR, getYear() ); - cal.set( Calendar.MONTH, getMonth() - 1 ); - cal.set( Calendar.DAY_OF_MONTH, getDay() ); - cal.set( Calendar.HOUR_OF_DAY, getHours() ); - cal.set( Calendar.MINUTE, getMinutes() ); - cal.set( Calendar.MILLISECOND, getMilliSeconds() ); - - return cal.getTimeInMillis(); - } - - /** - * System Time not locked to external time reference indicator - */ - public boolean isSystemTimeNotLockedToExternalReference() - { - return mMessage.get( SYSTEM_TIME_NOT_LOCKED_TO_EXTERNAL_REFERENCE ); - } - - /** - * Micro-slot-to-Minute rollover boundary lock indicator. - * - * Note: we invert the message value so that true indicates that the micro - * slots and minute rollovers are locked, whereas the ICD uses false to - * indicate a lock. - * - * @return true if the microslots rollover at each minute interval is locked - * to the system time minute rollover. - * - * @return false if the microslots and minutes rollover are not locked. This - * indicates that the microslots minute rollover is free rolling. - * - */ - public boolean isMicroslotsLockedToMinuteRollover() - { - return !mMessage.get( MICRO_SLOTS_TO_MINUTE_ROLLOVER_UNLOCKED ); - } - - /** - * Leap second correction value that should be applied to the system time. - * - * The leap-second correction field indicates the number of 2.5 millisecond - * units that must be added to the system time to account for the insertion - * of leap seconds when the system time is represented as UTC universal time. - * - * @return leap-second correction value in milliseconds 0.0-10.0 - */ - public double getLeapSecondCorrection() - { - return (double)mMessage.getInt( LEAP_SECOND_CORRECTION ) * 2.5d; - } - - - - /** - * Indicates the local time offset fields contain valid information. - */ - public boolean isValidLocalTimeOffset() - { - return !mMessage.get( LOCAL_TIME_OFFSET_VALID ); - } - - /** - * Local time zone offset from UTC universal time (zulu) when the VALID - * LOCAL TIME OFFSET flag indicates a valid offset. Otherwise, this method - * returns a static +00:00 indicating no local time offset. - */ - public TimeZone getTimeZone() - { - if( isValidLocalTimeOffset() ) - { - int offset = 0; - - offset += mMessage.getInt( LOCAL_TIME_OFFSET_HOURS ) * 3600000; - offset += mMessage.get( LOCAL_TIME_OFFSET_HALF_HOUR ) ? 1800000 : 0; - offset = mMessage.get( LOCAL_TIME_OFFSET_SIGN ) ? -offset : offset; - - return new SimpleTimeZone( offset, "LOCAL" ); - } - else - { - return NO_TIME_ZONE; - } - } - - /** - * System time - year. - * - * @return year in range 2000-2127 - */ - public int getYear() - { - return 2000 + mMessage.getInt( YEAR ); - } - - /** - * System time - month - * - * @return month 1-12 where 1=January and 12=December - */ - public int getMonth() - { - return mMessage.getInt( MONTH ); - } - - /** - * System time - day of month - * - * @return day of month in range 1-31 - */ - public int getDay() - { - return mMessage.getInt( DAY ); - } - - /** - * System time - hours - * - * @return hours in range 0 - 23 - */ - public int getHours() - { - return mMessage.getInt( HOURS ); - } - - /** - * System time - minutes - * - * @return minutes in range 0 - 59 - */ - public int getMinutes() - { - return mMessage.getInt( MINUTES ); - } - - /** - * System time - milli-seconds - * - * Note: sub-millisecond values are rounded to nearest millisecond unit to - * conform to java Date internal milli-second precision level. - * - * @return milli-seconds in range 0 - 59999; - */ - public int getMilliSeconds() - { - return (int)( (double)getMicroSlots() * 7.5 ); - } - - /** - * TDMA Micro Slots. - * - * Number of 7.5 millisecond micro slots since the last minute rollover, or - * since the last micro-slot counter rollover when the the micro-slot to - * minute rollover is unlocked. - * - * @see isMicroslotsLockedToMinuteRollover() method. - * - * This value supports mobile subscriber timing alignment with a TDMA traffic - * channel when a channel is granted from the control channels, so that when - * the mobile changes from the control channel to the traffic channel, it is - * already aligned with the traffic channel TDMA timing. - * - * Super frames occur every 360 ms (48 micro-slots) on FDMA and Ultra frames - * occur every 4 super frames on TDMA. - * - * Valid micro-slot values range 0-7999 and represent 60,000 - * milliseconds ( 8000 x 7.5 ms). - * - * @return number of 7.5 mS micro-slots since last minute or micro-slot - * rollover - */ - public int getMicroSlots() - { - return mMessage.getInt( MICRO_SLOTS ); - } +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.SimpleTimeZone; +import java.util.TimeZone; + +/** + * Sync Broadcast - used to broadcast FDMA-TDMA timing synchronization + * information so that a subscriber unit that is time synchronized on an FDMA + * control channel is also time synchronized with all TDMA traffic channels at + * the site. + */ +public class SyncBroadcast extends TSBKMessage +{ + public static final int[] RESERVED = { 80,81,82,83,84,85,86,87,88,89,90,91,92 }; + public static final int SYSTEM_TIME_NOT_LOCKED_TO_EXTERNAL_REFERENCE = 93; + public static final int MICRO_SLOTS_TO_MINUTE_ROLLOVER_UNLOCKED = 94; + public static final int[] LEAP_SECOND_CORRECTION = { 95,96 }; + public static final int LOCAL_TIME_OFFSET_VALID = 97; + public static final int LOCAL_TIME_OFFSET_SIGN = 98; + public static final int[] LOCAL_TIME_OFFSET_HOURS = { 99,100,101,102 }; + public static final int LOCAL_TIME_OFFSET_HALF_HOUR = 103; + + public static final int[] YEAR = { 104,105,106,107,108,109,110 }; + public static final int[] MONTH = { 111,112,113,114 }; + public static final int[] DAY = { 115,116,117,118,119 }; + public static final int[] HOURS = { 120,121,122,123,124 }; + public static final int[] MINUTES = { 125,126,127,128,129,130 }; + public static final int[] MICRO_SLOTS = { 131,132,133,134,135,136,137,138, + 139,140,141,142,143 }; + public static final int[] TSBK_CRC = { 144,145,146,147,148,149,150,151,152, + 153,154,155,156,157,158,159 }; + + private static final DateFormat TIME_FORMATTER = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss.SSS Z" ); + private static final TimeZone NO_TIME_ZONE = new SimpleTimeZone( 0, "NONE" ); + + public SyncBroadcast( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.TDMA_SYNC_BROADCAST.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + + sb.append( " SYSTEM TIME" ); + + if( isSystemTimeNotLockedToExternalReference() ) + { + sb.append( " UNLOCKED" ); + } + + sb.append( ":" ); + + TIME_FORMATTER.setTimeZone( getTimeZone() ); + sb.append( " " + TIME_FORMATTER.format( new Date( getSystemTime() ) ) ); + + sb.append( " LEAP-SECOND CORRECTION:" + getLeapSecondCorrection() + "mS" ); + + if( isMicroslotsLockedToMinuteRollover() ) + { + sb.append( " MICROSLOT-MINUTE ROLLOVER:LOCKED" ); + } + else + { + sb.append( " MICROSLOT-MINUTE ROLLOVER:UNLOCKED" ); + } + + return sb.toString(); + } + + /** + * System Time (UTC) in milliseconds since java epoch + */ + public long getSystemTime() + { + Calendar cal = Calendar.getInstance( TimeZone.getTimeZone( "UTC" ) ); + + cal.clear(); + + cal.set( Calendar.YEAR, getYear() ); + cal.set( Calendar.MONTH, getMonth() - 1 ); + cal.set( Calendar.DAY_OF_MONTH, getDay() ); + cal.set( Calendar.HOUR_OF_DAY, getHours() ); + cal.set( Calendar.MINUTE, getMinutes() ); + cal.set( Calendar.MILLISECOND, getMilliSeconds() ); + + return cal.getTimeInMillis(); + } + + /** + * System Time not locked to external time reference indicator + */ + public boolean isSystemTimeNotLockedToExternalReference() + { + return mMessage.get( SYSTEM_TIME_NOT_LOCKED_TO_EXTERNAL_REFERENCE ); + } + + /** + * Micro-slot-to-Minute rollover boundary lock indicator. + * + * Note: we invert the message value so that true indicates that the micro + * slots and minute rollovers are locked, whereas the ICD uses false to + * indicate a lock. + * + * @return true if the microslots rollover at each minute interval is locked + * to the system time minute rollover. + * + * @return false if the microslots and minutes rollover are not locked. This + * indicates that the microslots minute rollover is free rolling. + * + */ + public boolean isMicroslotsLockedToMinuteRollover() + { + return !mMessage.get( MICRO_SLOTS_TO_MINUTE_ROLLOVER_UNLOCKED ); + } + + /** + * Leap second correction value that should be applied to the system time. + * + * The leap-second correction field indicates the number of 2.5 millisecond + * units that must be added to the system time to account for the insertion + * of leap seconds when the system time is represented as UTC universal time. + * + * @return leap-second correction value in milliseconds 0.0-10.0 + */ + public double getLeapSecondCorrection() + { + return (double)mMessage.getInt( LEAP_SECOND_CORRECTION ) * 2.5d; + } + + + + /** + * Indicates the local time offset fields contain valid information. + */ + public boolean isValidLocalTimeOffset() + { + return !mMessage.get( LOCAL_TIME_OFFSET_VALID ); + } + + /** + * Local time zone offset from UTC universal time (zulu) when the VALID + * LOCAL TIME OFFSET flag indicates a valid offset. Otherwise, this method + * returns a static +00:00 indicating no local time offset. + */ + public TimeZone getTimeZone() + { + if( isValidLocalTimeOffset() ) + { + int offset = 0; + + offset += mMessage.getInt( LOCAL_TIME_OFFSET_HOURS ) * 3600000; + offset += mMessage.get( LOCAL_TIME_OFFSET_HALF_HOUR ) ? 1800000 : 0; + offset = mMessage.get( LOCAL_TIME_OFFSET_SIGN ) ? -offset : offset; + + return new SimpleTimeZone( offset, "LOCAL" ); + } + else + { + return NO_TIME_ZONE; + } + } + + /** + * System time - year. + * + * @return year in range 2000-2127 + */ + public int getYear() + { + return 2000 + mMessage.getInt( YEAR ); + } + + /** + * System time - month + * + * @return month 1-12 where 1=January and 12=December + */ + public int getMonth() + { + return mMessage.getInt( MONTH ); + } + + /** + * System time - day of month + * + * @return day of month in range 1-31 + */ + public int getDay() + { + return mMessage.getInt( DAY ); + } + + /** + * System time - hours + * + * @return hours in range 0 - 23 + */ + public int getHours() + { + return mMessage.getInt( HOURS ); + } + + /** + * System time - minutes + * + * @return minutes in range 0 - 59 + */ + public int getMinutes() + { + return mMessage.getInt( MINUTES ); + } + + /** + * System time - milli-seconds + * + * Note: sub-millisecond values are rounded to nearest millisecond unit to + * conform to java Date internal milli-second precision level. + * + * @return milli-seconds in range 0 - 59999; + */ + public int getMilliSeconds() + { + return (int)( (double)getMicroSlots() * 7.5 ); + } + + /** + * TDMA Micro Slots. + * + * Number of 7.5 millisecond micro slots since the last minute rollover, or + * since the last micro-slot counter rollover when the the micro-slot to + * minute rollover is unlocked. + * + * @see isMicroslotsLockedToMinuteRollover() method. + * + * This value supports mobile subscriber timing alignment with a TDMA traffic + * channel when a channel is granted from the control channels, so that when + * the mobile changes from the control channel to the traffic channel, it is + * already aligned with the traffic channel TDMA timing. + * + * Super frames occur every 360 ms (48 micro-slots) on FDMA and Ultra frames + * occur every 4 super frames on TDMA. + * + * Valid micro-slot values range 0-7999 and represent 60,000 + * milliseconds ( 8000 x 7.5 ms). + * + * @return number of 7.5 mS micro-slots since last minute or micro-slot + * rollover + */ + public int getMicroSlots() + { + return mMessage.getInt( MICRO_SLOTS ); + } } \ No newline at end of file diff --git a/src/module/decode/p25/message/tsbk/osp/control/SystemService.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SystemService.java similarity index 93% rename from src/module/decode/p25/message/tsbk/osp/control/SystemService.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SystemService.java index e296775a..14e07314 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/SystemService.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SystemService.java @@ -1,87 +1,87 @@ -package module.decode.p25.message.tsbk.osp.control; - -public class SystemService -{ - public static boolean isCompositeControlChannel( int service ) - { - return ( service & 0x01 ) == 0x01; - } - - public static boolean isUpdateControlChannelOnly( int service ) - { - return ( service & 0x02 ) == 0x02; - } - - public static boolean isBackupControlChannelOnly( int service ) - { - return ( service & 0x04 ) == 0x04; - } - - public static boolean providesDataServiceRequests( int service ) - { - return ( service & 0x10 ) == 0x10; - } - - public static boolean providesVoiceServiceRequests( int service ) - { - return ( service & 0x20 ) == 0x20; - } - - public static boolean providesRegistrationServices( int service ) - { - return ( service & 0x40 ) == 0x40; - } - - public static boolean providesAuthenticationServices( int service ) - { - return ( service & 0x80 ) == 0x80; - } - - public static String toString( int service ) - { - StringBuilder sb = new StringBuilder(); - - sb.append( "CONTROL CHAN[" ); - - if( isCompositeControlChannel( service ) ) - { - sb.append( " COMPOSITE" ); - } - - if( isUpdateControlChannelOnly( service ) ) - { - sb.append( " UPDATE" ); - } - - if( isBackupControlChannelOnly( service ) ) - { - sb.append( " BACKUP" ); - } - - sb.append( " ] SERVICES[" ); - - if( providesAuthenticationServices( service ) ) - { - sb.append( " AUTHENTICATION" ); - } - - if( providesDataServiceRequests( service ) ) - { - sb.append( " DATA" ); - } - - if( providesRegistrationServices( service ) ) - { - sb.append( " REGISTRATION" ); - } - - if( providesVoiceServiceRequests( service ) ) - { - sb.append( " VOICE" ); - } - - sb.append( " ]" ); - - return sb.toString(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +public class SystemService +{ + public static boolean isCompositeControlChannel( int service ) + { + return ( service & 0x01 ) == 0x01; + } + + public static boolean isUpdateControlChannelOnly( int service ) + { + return ( service & 0x02 ) == 0x02; + } + + public static boolean isBackupControlChannelOnly( int service ) + { + return ( service & 0x04 ) == 0x04; + } + + public static boolean providesDataServiceRequests( int service ) + { + return ( service & 0x10 ) == 0x10; + } + + public static boolean providesVoiceServiceRequests( int service ) + { + return ( service & 0x20 ) == 0x20; + } + + public static boolean providesRegistrationServices( int service ) + { + return ( service & 0x40 ) == 0x40; + } + + public static boolean providesAuthenticationServices( int service ) + { + return ( service & 0x80 ) == 0x80; + } + + public static String toString( int service ) + { + StringBuilder sb = new StringBuilder(); + + sb.append( "CONTROL CHAN[" ); + + if( isCompositeControlChannel( service ) ) + { + sb.append( " COMPOSITE" ); + } + + if( isUpdateControlChannelOnly( service ) ) + { + sb.append( " UPDATE" ); + } + + if( isBackupControlChannelOnly( service ) ) + { + sb.append( " BACKUP" ); + } + + sb.append( " ] SERVICES[" ); + + if( providesAuthenticationServices( service ) ) + { + sb.append( " AUTHENTICATION" ); + } + + if( providesDataServiceRequests( service ) ) + { + sb.append( " DATA" ); + } + + if( providesRegistrationServices( service ) ) + { + sb.append( " REGISTRATION" ); + } + + if( providesVoiceServiceRequests( service ) ) + { + sb.append( " VOICE" ); + } + + sb.append( " ]" ); + + return sb.toString(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/control/SystemServiceBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SystemServiceBroadcast.java similarity index 78% rename from src/module/decode/p25/message/tsbk/osp/control/SystemServiceBroadcast.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SystemServiceBroadcast.java index 4ff2b25f..a722abfb 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/SystemServiceBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SystemServiceBroadcast.java @@ -1,64 +1,64 @@ -package module.decode.p25.message.tsbk.osp.control; - -import java.util.List; - -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import module.decode.p25.reference.Service; -import alias.AliasList; -import bits.BinaryMessage; - -public class SystemServiceBroadcast extends TSBKMessage -{ - public static final int[] AVAILABLE_SERVICES = { 88,89,90,91,92,93,94,95, - 96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111 }; - public static final int[] SUPPORTED_SERVICES = { 112,113,114,115,116,117, - 118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135 }; - public static final int[] REQUEST_PRIORITY_LEVEL = { 136,137,138,139,140, - 141,142,143 }; - - public SystemServiceBroadcast( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.SYSTEM_SERVICE_BROADCAST.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - - sb.append( " SERVICES AVAILABLE " ); - - sb.append( getAvailableServices() ); - - sb.append( " SUPPORTED " ); - - sb.append( getSupportedServices() ); - - return sb.toString(); - } - - public List getAvailableServices() - { - long bitmap = mMessage.getLong( AVAILABLE_SERVICES ); - - return Service.getServices( bitmap ); - } - - public List getSupportedServices() - { - long bitmap = mMessage.getLong( SUPPORTED_SERVICES ); - - return Service.getServices( bitmap ); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; +import io.github.dsheirer.module.decode.p25.reference.Service; + +import java.util.List; + +public class SystemServiceBroadcast extends TSBKMessage +{ + public static final int[] AVAILABLE_SERVICES = { 88,89,90,91,92,93,94,95, + 96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111 }; + public static final int[] SUPPORTED_SERVICES = { 112,113,114,115,116,117, + 118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135 }; + public static final int[] REQUEST_PRIORITY_LEVEL = { 136,137,138,139,140, + 141,142,143 }; + + public SystemServiceBroadcast( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.SYSTEM_SERVICE_BROADCAST.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + + sb.append( " SERVICES AVAILABLE " ); + + sb.append( getAvailableServices() ); + + sb.append( " SUPPORTED " ); + + sb.append( getSupportedServices() ); + + return sb.toString(); + } + + public List getAvailableServices() + { + long bitmap = mMessage.getLong( AVAILABLE_SERVICES ); + + return Service.getServices( bitmap ); + } + + public List getSupportedServices() + { + long bitmap = mMessage.getLong( SUPPORTED_SERVICES ); + + return Service.getServices( bitmap ); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/control/TimeAndDateAnnouncement.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/TimeAndDateAnnouncement.java similarity index 90% rename from src/module/decode/p25/message/tsbk/osp/control/TimeAndDateAnnouncement.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/TimeAndDateAnnouncement.java index acd12f83..b85ea059 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/TimeAndDateAnnouncement.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/TimeAndDateAnnouncement.java @@ -1,4 +1,10 @@ -package module.decode.p25.message.tsbk.osp.control; +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; import java.text.SimpleDateFormat; import java.util.Calendar; @@ -6,12 +12,6 @@ import java.util.Date; import java.util.GregorianCalendar; import java.util.TimeZone; -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - public class TimeAndDateAnnouncement extends TSBKMessage { public static final int VALID_DATE_INDICATOR = 80; diff --git a/src/module/decode/p25/message/tsbk/osp/control/UnitDeregistrationAcknowledge.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/UnitDeregistrationAcknowledge.java similarity index 80% rename from src/module/decode/p25/message/tsbk/osp/control/UnitDeregistrationAcknowledge.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/UnitDeregistrationAcknowledge.java index b6b7817a..467a5bbf 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/UnitDeregistrationAcknowledge.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/UnitDeregistrationAcknowledge.java @@ -1,64 +1,64 @@ -package module.decode.p25.message.tsbk.osp.control; - -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class UnitDeregistrationAcknowledge extends TSBKMessage -{ - public static final int[] WACN = { 88,89,90,91,92,93,94,95,96,97,98,99,100, - 101,102,103,104,105,106,107 }; - public static final int[] SYSTEM_ID = { 108,109,110,111,112,113,114,115, - 116,117,118,119 }; - public static final int[] SOURCE_ID = { 120,121,122,123,124,125,126, - 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; - - public UnitDeregistrationAcknowledge( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.UNIT_DEREGISTRATION_ACKNOWLEDGE.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - - sb.append( " WACN:" + getWACN() ); - sb.append( " SYSTEM:" + getSystemID() ); - sb.append( " SRC ID: " + getSourceID() ); - - return sb.toString(); - } - - public String getWACN() - { - return mMessage.getHex( WACN, 5 ); - } - - public String getSystemID() - { - return mMessage.getHex( SYSTEM_ID, 3 ); - } - - public String getSourceID() - { - return mMessage.getHex( SOURCE_ID, 6 ); - } - - @Override - public String getToID() - { - return getSourceID(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class UnitDeregistrationAcknowledge extends TSBKMessage +{ + public static final int[] WACN = { 88,89,90,91,92,93,94,95,96,97,98,99,100, + 101,102,103,104,105,106,107 }; + public static final int[] SYSTEM_ID = { 108,109,110,111,112,113,114,115, + 116,117,118,119 }; + public static final int[] SOURCE_ID = { 120,121,122,123,124,125,126, + 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; + + public UnitDeregistrationAcknowledge( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.UNIT_DEREGISTRATION_ACKNOWLEDGE.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + + sb.append( " WACN:" + getWACN() ); + sb.append( " SYSTEM:" + getSystemID() ); + sb.append( " SRC ID: " + getSourceID() ); + + return sb.toString(); + } + + public String getWACN() + { + return mMessage.getHex( WACN, 5 ); + } + + public String getSystemID() + { + return mMessage.getHex( SYSTEM_ID, 3 ); + } + + public String getSourceID() + { + return mMessage.getHex( SOURCE_ID, 6 ); + } + + @Override + public String getToID() + { + return getSourceID(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/control/UnitRegistrationCommand.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/UnitRegistrationCommand.java similarity index 79% rename from src/module/decode/p25/message/tsbk/osp/control/UnitRegistrationCommand.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/UnitRegistrationCommand.java index b5d4b72a..00b15a9e 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/UnitRegistrationCommand.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/UnitRegistrationCommand.java @@ -1,62 +1,62 @@ -package module.decode.p25.message.tsbk.osp.control; - -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class UnitRegistrationCommand extends TSBKMessage -{ - public static final int[] TARGET_ADDRESS = { 96,97,98,99,100,101,102,103, - 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119 }; - public static final int[] SOURCE_ADDRESS = { 120,121,122,123,124,125,126, - 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; - - public UnitRegistrationCommand( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.UNIT_REGISTRATION_COMMAND.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - - sb.append( " SRC ADDR: " + getSourceAddress() ); - sb.append( " TGT ADDR: " + getTargetAddress() ); - - return sb.toString(); - } - - public String getSourceAddress() - { - return mMessage.getHex( SOURCE_ADDRESS, 6 ); - } - - @Override - public String getFromID() - { - return getSourceAddress(); - } - - public String getTargetAddress() - { - return mMessage.getHex( TARGET_ADDRESS, 6 ); - } - - @Override - public String getToID() - { - return getTargetAddress(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class UnitRegistrationCommand extends TSBKMessage +{ + public static final int[] TARGET_ADDRESS = { 96,97,98,99,100,101,102,103, + 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119 }; + public static final int[] SOURCE_ADDRESS = { 120,121,122,123,124,125,126, + 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; + + public UnitRegistrationCommand( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.UNIT_REGISTRATION_COMMAND.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + + sb.append( " SRC ADDR: " + getSourceAddress() ); + sb.append( " TGT ADDR: " + getTargetAddress() ); + + return sb.toString(); + } + + public String getSourceAddress() + { + return mMessage.getHex( SOURCE_ADDRESS, 6 ); + } + + @Override + public String getFromID() + { + return getSourceAddress(); + } + + public String getTargetAddress() + { + return mMessage.getHex( TARGET_ADDRESS, 6 ); + } + + @Override + public String getToID() + { + return getTargetAddress(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/control/UnitRegistrationResponse.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/UnitRegistrationResponse.java similarity index 80% rename from src/module/decode/p25/message/tsbk/osp/control/UnitRegistrationResponse.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/UnitRegistrationResponse.java index 7c85fd9a..e0c3d5da 100644 --- a/src/module/decode/p25/message/tsbk/osp/control/UnitRegistrationResponse.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/UnitRegistrationResponse.java @@ -1,71 +1,71 @@ -package module.decode.p25.message.tsbk.osp.control; - -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import module.decode.p25.reference.Response; -import alias.AliasList; -import bits.BinaryMessage; - -public class UnitRegistrationResponse extends TSBKMessage -{ - public static final int[] REGISTRATION_RESPONSE = { 82,83 }; - public static final int[] SYSTEM_ID = { 84,85,86,87,88,89,90,91,92,93,94,95 }; - public static final int[] SOURCE_ID = { 96,97,98,99,100,101,102,103, - 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119 }; - public static final int[] SOURCE_ADDRESS = { 120,121,122,123,124,125,126, - 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; - - public UnitRegistrationResponse( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.UNIT_REGISTRATION_RESPONSE.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - - sb.append( " REGISTRATION:" + getResponse().name() ); - sb.append( " SYSTEM:" + getSystemID() ); - sb.append( " SRC ID: " + getSourceID() ); - sb.append( " SRC ADDR: " + getSourceAddress() ); - - return sb.toString(); - } - - public Response getResponse() - { - return Response.fromValue( mMessage.getInt( REGISTRATION_RESPONSE ) ); - } - - public String getSystemID() - { - return mMessage.getHex( SYSTEM_ID, 3 ); - } - - public String getSourceID() - { - return mMessage.getHex( SOURCE_ID, 6 ); - } - - public String getSourceAddress() - { - return mMessage.getHex( SOURCE_ADDRESS, 6 ); - } - - @Override - public String getToID() - { - return getSourceAddress(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; +import io.github.dsheirer.module.decode.p25.reference.Response; + +public class UnitRegistrationResponse extends TSBKMessage +{ + public static final int[] REGISTRATION_RESPONSE = { 82,83 }; + public static final int[] SYSTEM_ID = { 84,85,86,87,88,89,90,91,92,93,94,95 }; + public static final int[] SOURCE_ID = { 96,97,98,99,100,101,102,103, + 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119 }; + public static final int[] SOURCE_ADDRESS = { 120,121,122,123,124,125,126, + 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; + + public UnitRegistrationResponse( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.UNIT_REGISTRATION_RESPONSE.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + + sb.append( " REGISTRATION:" + getResponse().name() ); + sb.append( " SYSTEM:" + getSystemID() ); + sb.append( " SRC ID: " + getSourceID() ); + sb.append( " SRC ADDR: " + getSourceAddress() ); + + return sb.toString(); + } + + public Response getResponse() + { + return Response.fromValue( mMessage.getInt( REGISTRATION_RESPONSE ) ); + } + + public String getSystemID() + { + return mMessage.getHex( SYSTEM_ID, 3 ); + } + + public String getSourceID() + { + return mMessage.getHex( SOURCE_ID, 6 ); + } + + public String getSourceAddress() + { + return mMessage.getHex( SOURCE_ADDRESS, 6 ); + } + + @Override + public String getToID() + { + return getSourceAddress(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/data/GroupDataChannelAnnouncement.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/GroupDataChannelAnnouncement.java similarity index 54% rename from src/module/decode/p25/message/tsbk/osp/data/GroupDataChannelAnnouncement.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/GroupDataChannelAnnouncement.java index 27cbafe3..70d0bd65 100644 --- a/src/module/decode/p25/message/tsbk/osp/data/GroupDataChannelAnnouncement.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/GroupDataChannelAnnouncement.java @@ -1,23 +1,23 @@ -package module.decode.p25.message.tsbk.osp.data; - -import module.decode.p25.message.tsbk.GroupMultiChannelGrant; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class GroupDataChannelAnnouncement extends GroupMultiChannelGrant -{ - public GroupDataChannelAnnouncement( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.GROUP_DATA_CHANNEL_ANNOUNCEMENT.getDescription(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.data; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.GroupMultiChannelGrant; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class GroupDataChannelAnnouncement extends GroupMultiChannelGrant +{ + public GroupDataChannelAnnouncement( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.GROUP_DATA_CHANNEL_ANNOUNCEMENT.getDescription(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/data/GroupDataChannelAnnouncementExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/GroupDataChannelAnnouncementExplicit.java similarity index 55% rename from src/module/decode/p25/message/tsbk/osp/data/GroupDataChannelAnnouncementExplicit.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/GroupDataChannelAnnouncementExplicit.java index fd4fe1bb..c71a9368 100644 --- a/src/module/decode/p25/message/tsbk/osp/data/GroupDataChannelAnnouncementExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/GroupDataChannelAnnouncementExplicit.java @@ -1,23 +1,23 @@ -package module.decode.p25.message.tsbk.osp.data; - -import module.decode.p25.message.tsbk.GroupChannelGrantExplicit; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class GroupDataChannelAnnouncementExplicit extends GroupChannelGrantExplicit -{ - public GroupDataChannelAnnouncementExplicit( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.GROUP_DATA_CHANNEL_ANNOUNCEMENT_EXPLICIT.getDescription(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.data; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.GroupChannelGrantExplicit; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class GroupDataChannelAnnouncementExplicit extends GroupChannelGrantExplicit +{ + public GroupDataChannelAnnouncementExplicit( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.GROUP_DATA_CHANNEL_ANNOUNCEMENT_EXPLICIT.getDescription(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/data/GroupDataChannelGrant.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/GroupDataChannelGrant.java similarity index 76% rename from src/module/decode/p25/message/tsbk/osp/data/GroupDataChannelGrant.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/GroupDataChannelGrant.java index 42be5c6b..5ffbe530 100644 --- a/src/module/decode/p25/message/tsbk/osp/data/GroupDataChannelGrant.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/GroupDataChannelGrant.java @@ -1,40 +1,40 @@ -/******************************************************************************* - * 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 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 - * - ******************************************************************************/ -package module.decode.p25.message.tsbk.osp.data; - -import alias.AliasList; -import bits.BinaryMessage; -import module.decode.p25.message.tsbk.GroupChannelGrant; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; - -public class GroupDataChannelGrant extends GroupChannelGrant - -{ - public GroupDataChannelGrant(BinaryMessage message, DataUnitID duid, AliasList aliasList) - { - super(message, duid, aliasList); - } - - @Override - public String getEventType() - { - return Opcode.GROUP_DATA_CHANNEL_GRANT.getDescription(); - } -} +/******************************************************************************* + * 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 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 + * + ******************************************************************************/ +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.data; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.GroupChannelGrant; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class GroupDataChannelGrant extends GroupChannelGrant + +{ + public GroupDataChannelGrant(BinaryMessage message, DataUnitID duid, AliasList aliasList) + { + super(message, duid, aliasList); + } + + @Override + public String getEventType() + { + return Opcode.GROUP_DATA_CHANNEL_GRANT.getDescription(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/data/IndividualDataChannelGrant.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/IndividualDataChannelGrant.java similarity index 54% rename from src/module/decode/p25/message/tsbk/osp/data/IndividualDataChannelGrant.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/IndividualDataChannelGrant.java index 905f9a5d..7f0067a3 100644 --- a/src/module/decode/p25/message/tsbk/osp/data/IndividualDataChannelGrant.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/IndividualDataChannelGrant.java @@ -1,23 +1,23 @@ -package module.decode.p25.message.tsbk.osp.data; - -import module.decode.p25.message.tsbk.UnitChannelGrant; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class IndividualDataChannelGrant extends UnitChannelGrant -{ - public IndividualDataChannelGrant( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.INDIVIDUAL_DATA_CHANNEL_GRANT.getDescription(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.data; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.UnitChannelGrant; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class IndividualDataChannelGrant extends UnitChannelGrant +{ + public IndividualDataChannelGrant( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.INDIVIDUAL_DATA_CHANNEL_GRANT.getDescription(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/data/SNDCPData.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPData.java similarity index 72% rename from src/module/decode/p25/message/tsbk/osp/data/SNDCPData.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPData.java index e5559def..870e27e0 100644 --- a/src/module/decode/p25/message/tsbk/osp/data/SNDCPData.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPData.java @@ -1,29 +1,29 @@ -package module.decode.p25.message.tsbk.osp.data; - -import module.decode.p25.message.tsbk.ServiceMessage; -import module.decode.p25.reference.DataUnitID; -import alias.AliasList; -import bits.BinaryMessage; - -public abstract class SNDCPData extends ServiceMessage -{ - public static final int[] NETWORK_SERVICE_ACCESS_POINT_ID = { 84,85,86,87 }; - - public static final int[] TARGET_ADDRESS = { 96,97,98,99,100,101,102,103, - 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119 }; - - public static final int[] SOURCE_ADDRESS = { 120,121,122,123,124,125,126, - 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; - - public SNDCPData( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - public String getNSAPI() - { - return mMessage.getHex( NETWORK_SERVICE_ACCESS_POINT_ID, 1 ); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.data; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.ServiceMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; + +public abstract class SNDCPData extends ServiceMessage +{ + public static final int[] NETWORK_SERVICE_ACCESS_POINT_ID = { 84,85,86,87 }; + + public static final int[] TARGET_ADDRESS = { 96,97,98,99,100,101,102,103, + 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119 }; + + public static final int[] SOURCE_ADDRESS = { 120,121,122,123,124,125,126, + 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; + + public SNDCPData( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + public String getNSAPI() + { + return mMessage.getHex( NETWORK_SERVICE_ACCESS_POINT_ID, 1 ); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/data/SNDCPDataChannelAnnouncementExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPDataChannelAnnouncementExplicit.java similarity index 93% rename from src/module/decode/p25/message/tsbk/osp/data/SNDCPDataChannelAnnouncementExplicit.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPDataChannelAnnouncementExplicit.java index f8aec423..a4ef3e3e 100644 --- a/src/module/decode/p25/message/tsbk/osp/data/SNDCPDataChannelAnnouncementExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPDataChannelAnnouncementExplicit.java @@ -16,13 +16,13 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.tsbk.osp.data; +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.data; -import alias.AliasList; -import bits.BinaryMessage; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; public class SNDCPDataChannelAnnouncementExplicit extends SNDCPData implements IdentifierReceiver { diff --git a/src/module/decode/p25/message/tsbk/osp/data/SNDCPDataChannelGrant.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPDataChannelGrant.java similarity index 92% rename from src/module/decode/p25/message/tsbk/osp/data/SNDCPDataChannelGrant.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPDataChannelGrant.java index 31e62211..ccac4d50 100644 --- a/src/module/decode/p25/message/tsbk/osp/data/SNDCPDataChannelGrant.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPDataChannelGrant.java @@ -16,13 +16,13 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.p25.message.tsbk.osp.data; +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.data; -import alias.AliasList; -import bits.BinaryMessage; -import module.decode.p25.message.IBandIdentifier; -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; public class SNDCPDataChannelGrant extends SNDCPData implements IdentifierReceiver { diff --git a/src/module/decode/p25/message/tsbk/osp/data/SNDCPDataPageRequest.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPDataPageRequest.java similarity index 83% rename from src/module/decode/p25/message/tsbk/osp/data/SNDCPDataPageRequest.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPDataPageRequest.java index 3fc0ef04..1219f873 100644 --- a/src/module/decode/p25/message/tsbk/osp/data/SNDCPDataPageRequest.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPDataPageRequest.java @@ -1,8 +1,8 @@ -package module.decode.p25.message.tsbk.osp.data; +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.data; -import module.decode.p25.reference.DataUnitID; -import alias.AliasList; -import bits.BinaryMessage; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; public class SNDCPDataPageRequest extends SNDCPData { diff --git a/src/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrant.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrant.java similarity index 53% rename from src/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrant.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrant.java index 982d9510..fb743fec 100644 --- a/src/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrant.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrant.java @@ -1,24 +1,24 @@ -package module.decode.p25.message.tsbk.osp.voice; - -import module.decode.p25.message.tsbk.GroupChannelGrant; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class GroupVoiceChannelGrant extends GroupChannelGrant -{ - public GroupVoiceChannelGrant( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.GROUP_VOICE_CHANNEL_GRANT.getDescription(); - } - -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.GroupChannelGrant; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class GroupVoiceChannelGrant extends GroupChannelGrant +{ + public GroupVoiceChannelGrant( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.GROUP_VOICE_CHANNEL_GRANT.getDescription(); + } + +} diff --git a/src/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrantUpdate.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrantUpdate.java similarity index 54% rename from src/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrantUpdate.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrantUpdate.java index a202ecd1..082c499c 100644 --- a/src/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrantUpdate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrantUpdate.java @@ -1,23 +1,23 @@ -package module.decode.p25.message.tsbk.osp.voice; - -import module.decode.p25.message.tsbk.GroupMultiChannelGrant; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class GroupVoiceChannelGrantUpdate extends GroupMultiChannelGrant -{ - public GroupVoiceChannelGrantUpdate( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.GROUP_VOICE_CHANNEL_GRANT_UPDATE.getDescription(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.GroupMultiChannelGrant; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class GroupVoiceChannelGrantUpdate extends GroupMultiChannelGrant +{ + public GroupVoiceChannelGrantUpdate( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.GROUP_VOICE_CHANNEL_GRANT_UPDATE.getDescription(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrantUpdateExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrantUpdateExplicit.java similarity index 55% rename from src/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrantUpdateExplicit.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrantUpdateExplicit.java index 46831755..066f3a75 100644 --- a/src/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrantUpdateExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrantUpdateExplicit.java @@ -1,23 +1,23 @@ -package module.decode.p25.message.tsbk.osp.voice; - -import module.decode.p25.message.tsbk.GroupChannelGrantExplicit; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class GroupVoiceChannelGrantUpdateExplicit extends GroupChannelGrantExplicit -{ - public GroupVoiceChannelGrantUpdateExplicit( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.GROUP_VOICE_CHANNEL_GRANT_UPDATE_EXPLICIT.getDescription(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.GroupChannelGrantExplicit; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class GroupVoiceChannelGrantUpdateExplicit extends GroupChannelGrantExplicit +{ + public GroupVoiceChannelGrantUpdateExplicit( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.GROUP_VOICE_CHANNEL_GRANT_UPDATE_EXPLICIT.getDescription(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectAnswerRequest.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectAnswerRequest.java similarity index 85% rename from src/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectAnswerRequest.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectAnswerRequest.java index c21efcd1..c0944228 100644 --- a/src/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectAnswerRequest.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectAnswerRequest.java @@ -1,85 +1,85 @@ -package module.decode.p25.message.tsbk.osp.voice; - -import java.util.ArrayList; -import java.util.List; - -import module.decode.p25.message.tsbk.TSBKMessage; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Digit; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class TelephoneInterconnectAnswerRequest extends TSBKMessage -{ - public static final int[] DIGIT_1 = { 80,81,82,83 }; - public static final int[] DIGIT_2 = { 84,85,86,87 }; - public static final int[] DIGIT_3 = { 88,89,90,91 }; - public static final int[] DIGIT_4 = { 92,93,94,95 }; - public static final int[] DIGIT_5 = { 96,97,98,99 }; - public static final int[] DIGIT_6 = { 100,101,102,103 }; - public static final int[] DIGIT_7 = { 104,105,106,107 }; - public static final int[] DIGIT_8 = { 108,109,110,111 }; - public static final int[] DIGIT_9 = { 112,113,114,115 }; - public static final int[] DIGIT_10 = { 116,117,118,119 }; - - public static final int[] TARGET_ADDRESS = { 120,121,122,123,124,125,126, - 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; - - public TelephoneInterconnectAnswerRequest( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.TELEPHONE_INTERCONNECT_ANSWER_REQUEST.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - - sb.append( " TO:" ); - sb.append( getTargetAddress() ); - - sb.append( " TEL:" ); - sb.append( getTelephoneNumber() ); - - return sb.toString(); - } - - public String getTelephoneNumber() - { - List digits = new ArrayList(); - - digits.add( mMessage.getInt( DIGIT_1 ) ); - digits.add( mMessage.getInt( DIGIT_2 ) ); - digits.add( mMessage.getInt( DIGIT_3 ) ); - digits.add( mMessage.getInt( DIGIT_4 ) ); - digits.add( mMessage.getInt( DIGIT_5 ) ); - digits.add( mMessage.getInt( DIGIT_6 ) ); - digits.add( mMessage.getInt( DIGIT_7 ) ); - digits.add( mMessage.getInt( DIGIT_8 ) ); - digits.add( mMessage.getInt( DIGIT_9 ) ); - digits.add( mMessage.getInt( DIGIT_10 ) ); - - return Digit.decode( digits ); - } - - public String getTargetAddress() - { - return mMessage.getHex( TARGET_ADDRESS, 6 ); - } - - @Override - public String getToID() - { - return getTargetAddress(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Digit; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +import java.util.ArrayList; +import java.util.List; + +public class TelephoneInterconnectAnswerRequest extends TSBKMessage +{ + public static final int[] DIGIT_1 = { 80,81,82,83 }; + public static final int[] DIGIT_2 = { 84,85,86,87 }; + public static final int[] DIGIT_3 = { 88,89,90,91 }; + public static final int[] DIGIT_4 = { 92,93,94,95 }; + public static final int[] DIGIT_5 = { 96,97,98,99 }; + public static final int[] DIGIT_6 = { 100,101,102,103 }; + public static final int[] DIGIT_7 = { 104,105,106,107 }; + public static final int[] DIGIT_8 = { 108,109,110,111 }; + public static final int[] DIGIT_9 = { 112,113,114,115 }; + public static final int[] DIGIT_10 = { 116,117,118,119 }; + + public static final int[] TARGET_ADDRESS = { 120,121,122,123,124,125,126, + 127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 }; + + public TelephoneInterconnectAnswerRequest( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.TELEPHONE_INTERCONNECT_ANSWER_REQUEST.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + + sb.append( " TO:" ); + sb.append( getTargetAddress() ); + + sb.append( " TEL:" ); + sb.append( getTelephoneNumber() ); + + return sb.toString(); + } + + public String getTelephoneNumber() + { + List digits = new ArrayList(); + + digits.add( mMessage.getInt( DIGIT_1 ) ); + digits.add( mMessage.getInt( DIGIT_2 ) ); + digits.add( mMessage.getInt( DIGIT_3 ) ); + digits.add( mMessage.getInt( DIGIT_4 ) ); + digits.add( mMessage.getInt( DIGIT_5 ) ); + digits.add( mMessage.getInt( DIGIT_6 ) ); + digits.add( mMessage.getInt( DIGIT_7 ) ); + digits.add( mMessage.getInt( DIGIT_8 ) ); + digits.add( mMessage.getInt( DIGIT_9 ) ); + digits.add( mMessage.getInt( DIGIT_10 ) ); + + return Digit.decode( digits ); + } + + public String getTargetAddress() + { + return mMessage.getHex( TARGET_ADDRESS, 6 ); + } + + @Override + public String getToID() + { + return getTargetAddress(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectVoiceChannelGrant.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectVoiceChannelGrant.java similarity index 79% rename from src/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectVoiceChannelGrant.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectVoiceChannelGrant.java index 61553d59..16725c33 100644 --- a/src/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectVoiceChannelGrant.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectVoiceChannelGrant.java @@ -1,66 +1,66 @@ -package module.decode.p25.message.tsbk.osp.voice; - -import module.decode.p25.message.tsbk.UnitChannelGrant; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class TelephoneInterconnectVoiceChannelGrant extends UnitChannelGrant -{ - public static final int[] CALL_TIMER = { 96,97,98,99,100,101,102,103, - 104,105,106,107,108,109,110,111 }; - - public TelephoneInterconnectVoiceChannelGrant( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - - if( isEmergency() ) - { - sb.append( " EMERGENCY" ); - } - - sb.append( " ADDR:" + getSourceAddress() ); - - sb.append( " CHAN:" ); - sb.append( getChannel() ); - - sb.append( " CALL TIMER:" ); - sb.append( getCallTimer() ); - - sb.append( " SECS TO:" ); - sb.append( getToID() ); - - return sb.toString(); - } - - public String getAddress() - { - return getSourceAddress(); - } - - /** - * Call timer in seconds - */ - public int getCallTimer() - { - int units = mMessage.getInt( CALL_TIMER ); - - return (int)( units / 10 ); - } - - @Override - public String getEventType() - { - return Opcode.TELEPHONE_INTERCONNECT_VOICE_CHANNEL_GRANT.getDescription(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.UnitChannelGrant; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class TelephoneInterconnectVoiceChannelGrant extends UnitChannelGrant +{ + public static final int[] CALL_TIMER = { 96,97,98,99,100,101,102,103, + 104,105,106,107,108,109,110,111 }; + + public TelephoneInterconnectVoiceChannelGrant( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + + if( isEmergency() ) + { + sb.append( " EMERGENCY" ); + } + + sb.append( " ADDR:" + getSourceAddress() ); + + sb.append( " CHAN:" ); + sb.append( getChannel() ); + + sb.append( " CALL TIMER:" ); + sb.append( getCallTimer() ); + + sb.append( " SECS TO:" ); + sb.append( getToID() ); + + return sb.toString(); + } + + public String getAddress() + { + return getSourceAddress(); + } + + /** + * Call timer in seconds + */ + public int getCallTimer() + { + int units = mMessage.getInt( CALL_TIMER ); + + return (int)( units / 10 ); + } + + @Override + public String getEventType() + { + return Opcode.TELEPHONE_INTERCONNECT_VOICE_CHANNEL_GRANT.getDescription(); + } +} diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectVoiceChannelGrantUpdate.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectVoiceChannelGrantUpdate.java new file mode 100644 index 00000000..db6b95e7 --- /dev/null +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectVoiceChannelGrantUpdate.java @@ -0,0 +1,23 @@ +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class TelephoneInterconnectVoiceChannelGrantUpdate + extends TelephoneInterconnectVoiceChannelGrant +{ + + public TelephoneInterconnectVoiceChannelGrantUpdate(BinaryMessage message, + DataUnitID duid, AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.TELEPHONE_INTERCONNECT_VOICE_CHANNEL_GRANT_UPDATE.getDescription(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/voice/UnitToUnitAnswerRequest.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/UnitToUnitAnswerRequest.java similarity index 53% rename from src/module/decode/p25/message/tsbk/osp/voice/UnitToUnitAnswerRequest.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/UnitToUnitAnswerRequest.java index 370ee3d6..5240d7d7 100644 --- a/src/module/decode/p25/message/tsbk/osp/voice/UnitToUnitAnswerRequest.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/UnitToUnitAnswerRequest.java @@ -1,23 +1,23 @@ -package module.decode.p25.message.tsbk.osp.voice; - -import module.decode.p25.message.tsbk.UnitChannelGrant; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class UnitToUnitAnswerRequest extends UnitChannelGrant -{ - public UnitToUnitAnswerRequest( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.UNIT_TO_UNIT_ANSWER_REQUEST.getDescription(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.UnitChannelGrant; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class UnitToUnitAnswerRequest extends UnitChannelGrant +{ + public UnitToUnitAnswerRequest( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.UNIT_TO_UNIT_ANSWER_REQUEST.getDescription(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/voice/UnitToUnitVoiceChannelGrant.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/UnitToUnitVoiceChannelGrant.java similarity index 74% rename from src/module/decode/p25/message/tsbk/osp/voice/UnitToUnitVoiceChannelGrant.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/UnitToUnitVoiceChannelGrant.java index abb224db..6ac7541d 100644 --- a/src/module/decode/p25/message/tsbk/osp/voice/UnitToUnitVoiceChannelGrant.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/UnitToUnitVoiceChannelGrant.java @@ -1,47 +1,47 @@ -package module.decode.p25.message.tsbk.osp.voice; - -import module.decode.p25.message.tsbk.UnitChannelGrant; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class UnitToUnitVoiceChannelGrant extends UnitChannelGrant -{ - public UnitToUnitVoiceChannelGrant( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.UNIT_TO_UNIT_VOICE_CHANNEL_GRANT.getDescription(); - } - - public String getMessage() - { - StringBuilder sb = new StringBuilder(); - - sb.append( getMessageStub() ); - - if( isEmergency() ) - { - sb.append( " EMERGENCY" ); - } - - sb.append( " SOURCE UNIT:" ); - sb.append( getSourceAddress() ); - - sb.append( " TARGET UNIT:" ); - sb.append( getTargetAddress() ); - - sb.append( " CHAN:" + getChannelIdentifier() + "-" + getChannelNumber() ); - sb.append( " DN:" + getDownlinkFrequency() ); - sb.append( " UP:" + getUplinkFrequency() ); - - return sb.toString(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.UnitChannelGrant; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class UnitToUnitVoiceChannelGrant extends UnitChannelGrant +{ + public UnitToUnitVoiceChannelGrant( BinaryMessage message, + DataUnitID duid, + AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.UNIT_TO_UNIT_VOICE_CHANNEL_GRANT.getDescription(); + } + + public String getMessage() + { + StringBuilder sb = new StringBuilder(); + + sb.append( getMessageStub() ); + + if( isEmergency() ) + { + sb.append( " EMERGENCY" ); + } + + sb.append( " SOURCE UNIT:" ); + sb.append( getSourceAddress() ); + + sb.append( " TARGET UNIT:" ); + sb.append( getTargetAddress() ); + + sb.append( " CHAN:" + getChannelIdentifier() + "-" + getChannelNumber() ); + sb.append( " DN:" + getDownlinkFrequency() ); + sb.append( " UP:" + getUplinkFrequency() ); + + return sb.toString(); + } +} diff --git a/src/module/decode/p25/message/tsbk/osp/voice/UnitToUnitVoiceChannelGrantUpdate.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/UnitToUnitVoiceChannelGrantUpdate.java similarity index 52% rename from src/module/decode/p25/message/tsbk/osp/voice/UnitToUnitVoiceChannelGrantUpdate.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/UnitToUnitVoiceChannelGrantUpdate.java index 9b88d265..29e23e97 100644 --- a/src/module/decode/p25/message/tsbk/osp/voice/UnitToUnitVoiceChannelGrantUpdate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/UnitToUnitVoiceChannelGrantUpdate.java @@ -1,22 +1,22 @@ -package module.decode.p25.message.tsbk.osp.voice; - -import module.decode.p25.message.tsbk.UnitChannelGrant; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class UnitToUnitVoiceChannelGrantUpdate extends UnitChannelGrant -{ - public UnitToUnitVoiceChannelGrantUpdate( BinaryMessage message, - DataUnitID duid, AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.UNIT_TO_UNIT_VOICE_CHANNEL_GRANT_UPDATE.getDescription(); - } -} +package io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.tsbk.UnitChannelGrant; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Opcode; + +public class UnitToUnitVoiceChannelGrantUpdate extends UnitChannelGrant +{ + public UnitToUnitVoiceChannelGrantUpdate( BinaryMessage message, + DataUnitID duid, AliasList aliasList ) + { + super( message, duid, aliasList ); + } + + @Override + public String getEventType() + { + return Opcode.UNIT_TO_UNIT_VOICE_CHANNEL_GRANT_UPDATE.getDescription(); + } +} diff --git a/src/module/decode/p25/message/tsbk/vendor/VendorOpcode.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/vendor/VendorOpcode.java similarity index 98% rename from src/module/decode/p25/message/tsbk/vendor/VendorOpcode.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/vendor/VendorOpcode.java index 0067a098..acfd0524 100644 --- a/src/module/decode/p25/message/tsbk/vendor/VendorOpcode.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/vendor/VendorOpcode.java @@ -1,4 +1,4 @@ -package module.decode.p25.message.tsbk.vendor; +package io.github.dsheirer.module.decode.p25.message.tsbk.vendor; public enum VendorOpcode { diff --git a/src/module/decode/p25/message/vselp/VSELP1Message.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/vselp/VSELP1Message.java similarity index 70% rename from src/module/decode/p25/message/vselp/VSELP1Message.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/vselp/VSELP1Message.java index 8f0ca8c8..15af9627 100644 --- a/src/module/decode/p25/message/vselp/VSELP1Message.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/vselp/VSELP1Message.java @@ -1,9 +1,9 @@ -package module.decode.p25.message.vselp; +package io.github.dsheirer.module.decode.p25.message.vselp; -import module.decode.p25.message.P25Message; -import module.decode.p25.reference.DataUnitID; -import alias.AliasList; -import bits.BinaryMessage; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.P25Message; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; public class VSELP1Message extends P25Message { diff --git a/src/module/decode/p25/message/vselp/VSELP2Message.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/vselp/VSELP2Message.java similarity index 70% rename from src/module/decode/p25/message/vselp/VSELP2Message.java rename to src/main/java/io/github/dsheirer/module/decode/p25/message/vselp/VSELP2Message.java index e6e1b1c6..886d652a 100644 --- a/src/module/decode/p25/message/vselp/VSELP2Message.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/vselp/VSELP2Message.java @@ -1,9 +1,9 @@ -package module.decode.p25.message.vselp; +package io.github.dsheirer.module.decode.p25.message.vselp; -import alias.AliasList; -import bits.BinaryMessage; -import module.decode.p25.message.P25Message; -import module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.message.P25Message; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; public class VSELP2Message extends P25Message { diff --git a/src/module/decode/p25/reference/DataUnitID.java b/src/main/java/io/github/dsheirer/module/decode/p25/reference/DataUnitID.java similarity index 97% rename from src/module/decode/p25/reference/DataUnitID.java rename to src/main/java/io/github/dsheirer/module/decode/p25/reference/DataUnitID.java index eba7fa42..a0498efb 100644 --- a/src/module/decode/p25/reference/DataUnitID.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/reference/DataUnitID.java @@ -1,4 +1,4 @@ -package module.decode.p25.reference; +package io.github.dsheirer.module.decode.p25.reference; /** * The Data Unit ID (DUID) is part of the Network ID (NID) field and indicates diff --git a/src/module/decode/p25/reference/DenyReason.java b/src/main/java/io/github/dsheirer/module/decode/p25/reference/DenyReason.java similarity index 95% rename from src/module/decode/p25/reference/DenyReason.java rename to src/main/java/io/github/dsheirer/module/decode/p25/reference/DenyReason.java index 1668bf68..666141b3 100644 --- a/src/module/decode/p25/reference/DenyReason.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/reference/DenyReason.java @@ -1,125 +1,125 @@ -package module.decode.p25.reference; - -public enum DenyReason -{ - RESERVED( 0x00 ), - REQUESTING_UNIT_NOT_VALID( 0x10 ), - REQUESTING_UNIT_NOT_AUTHORIZED_FOR_SERVICE( 0x11 ), - TARGET_UNIT_NOT_VALID( 0x20 ), - TARGET_UNIT_NOT_AUTHORIZED_FOR_SERVICE( 0x21 ), - TARGET_UNIT_REFUSED_CALL( 0x2F ), - TARGET_GROUP_NOT_VALID( 0x30 ), - TARGET_GROUP_NOT_AUTHORIZED_FOR_SERVICE( 0x31 ), - INVALID_DIALING( 0x40 ), - TELEPHONE_NUMBER_NOT_AUTHORIZED( 0x41 ), - PSTN_NOT_VALID( 0x42 ), - CALL_TIMEOUT( 0x50 ), - LANDLINE_TERMINATED_CALL( 0x51 ), - SUBSCRIBER_UNIT_TERMINATED_CALL( 0x52 ), - CALL_PREEMPTED( 0x5F ), - SITE_ACCESS_DENIAL( 0x60 ), - USER_OR_SYSTEM_DEFINED( 0x61 ), - CALL_OPTIONS_NOT_VALID_FOR_SERVICE( 0xF0 ), - PROTECTION_SERVICE_OPTION_NOT_VALID( 0xF1 ), - DUPLEX_SERVICE_OPTION_NOT_VALID( 0xF2 ), - CIRCUIT_OR_PACKET_MODE_OPTION_NOT_VALID( 0xF3 ), - SYSTEM_DOES_NOT_SUPPORT_SERVICE( 0xFF ), - UNKNOWN( -1 ); - - private int mCode; - - private DenyReason( int code ) - { - mCode = code; - } - - public static DenyReason fromCode( int code ) - { - if( code == 0x10 ) - { - return DenyReason.REQUESTING_UNIT_NOT_VALID; - } - else if( code == 0x11 ) - { - return REQUESTING_UNIT_NOT_AUTHORIZED_FOR_SERVICE; - } - else if( code == 0x20 ) - { - return DenyReason.TARGET_UNIT_NOT_VALID; - } - else if( code == 0x21 ) - { - return TARGET_UNIT_NOT_AUTHORIZED_FOR_SERVICE; - } - else if( code == 0x2F ) - { - return DenyReason.TARGET_UNIT_REFUSED_CALL; - } - else if( code == 0x30 ) - { - return TARGET_GROUP_NOT_VALID; - } - else if( code == 0x31 ) - { - return DenyReason.TARGET_GROUP_NOT_AUTHORIZED_FOR_SERVICE; - } - else if( code == 0x40 ) - { - return DenyReason.INVALID_DIALING; - } - else if( code == 0x41 ) - { - return DenyReason.TELEPHONE_NUMBER_NOT_AUTHORIZED; - } - else if( code == 0x42 ) - { - return DenyReason.PSTN_NOT_VALID; - } - else if( code == 0x50 ) - { - return CALL_TIMEOUT; - } - else if( code == 0x51 ) - { - return LANDLINE_TERMINATED_CALL; - } - else if( code == 0x52 ) - { - return SUBSCRIBER_UNIT_TERMINATED_CALL; - } - else if( code == 0x5F ) - { - return DenyReason.CALL_PREEMPTED; - } - else if( code == 0x60 ) - { - return SITE_ACCESS_DENIAL; - } - else if( code == 0xF0 ) - { - return CALL_OPTIONS_NOT_VALID_FOR_SERVICE; - } - else if( code == 0xF1 ) - { - return PROTECTION_SERVICE_OPTION_NOT_VALID; - } - else if( code == 0xF2 ) - { - return DenyReason.DUPLEX_SERVICE_OPTION_NOT_VALID; - } - else if( code == 0xF3 ) - { - return CIRCUIT_OR_PACKET_MODE_OPTION_NOT_VALID; - } - else if( code <= 0x5E ) - { - return DenyReason.RESERVED; - } - else if( code >= 0x61 ) - { - return DenyReason.USER_OR_SYSTEM_DEFINED; - } - - return UNKNOWN; - } -} +package io.github.dsheirer.module.decode.p25.reference; + +public enum DenyReason +{ + RESERVED( 0x00 ), + REQUESTING_UNIT_NOT_VALID( 0x10 ), + REQUESTING_UNIT_NOT_AUTHORIZED_FOR_SERVICE( 0x11 ), + TARGET_UNIT_NOT_VALID( 0x20 ), + TARGET_UNIT_NOT_AUTHORIZED_FOR_SERVICE( 0x21 ), + TARGET_UNIT_REFUSED_CALL( 0x2F ), + TARGET_GROUP_NOT_VALID( 0x30 ), + TARGET_GROUP_NOT_AUTHORIZED_FOR_SERVICE( 0x31 ), + INVALID_DIALING( 0x40 ), + TELEPHONE_NUMBER_NOT_AUTHORIZED( 0x41 ), + PSTN_NOT_VALID( 0x42 ), + CALL_TIMEOUT( 0x50 ), + LANDLINE_TERMINATED_CALL( 0x51 ), + SUBSCRIBER_UNIT_TERMINATED_CALL( 0x52 ), + CALL_PREEMPTED( 0x5F ), + SITE_ACCESS_DENIAL( 0x60 ), + USER_OR_SYSTEM_DEFINED( 0x61 ), + CALL_OPTIONS_NOT_VALID_FOR_SERVICE( 0xF0 ), + PROTECTION_SERVICE_OPTION_NOT_VALID( 0xF1 ), + DUPLEX_SERVICE_OPTION_NOT_VALID( 0xF2 ), + CIRCUIT_OR_PACKET_MODE_OPTION_NOT_VALID( 0xF3 ), + SYSTEM_DOES_NOT_SUPPORT_SERVICE( 0xFF ), + UNKNOWN( -1 ); + + private int mCode; + + private DenyReason( int code ) + { + mCode = code; + } + + public static DenyReason fromCode( int code ) + { + if( code == 0x10 ) + { + return DenyReason.REQUESTING_UNIT_NOT_VALID; + } + else if( code == 0x11 ) + { + return REQUESTING_UNIT_NOT_AUTHORIZED_FOR_SERVICE; + } + else if( code == 0x20 ) + { + return DenyReason.TARGET_UNIT_NOT_VALID; + } + else if( code == 0x21 ) + { + return TARGET_UNIT_NOT_AUTHORIZED_FOR_SERVICE; + } + else if( code == 0x2F ) + { + return DenyReason.TARGET_UNIT_REFUSED_CALL; + } + else if( code == 0x30 ) + { + return TARGET_GROUP_NOT_VALID; + } + else if( code == 0x31 ) + { + return DenyReason.TARGET_GROUP_NOT_AUTHORIZED_FOR_SERVICE; + } + else if( code == 0x40 ) + { + return DenyReason.INVALID_DIALING; + } + else if( code == 0x41 ) + { + return DenyReason.TELEPHONE_NUMBER_NOT_AUTHORIZED; + } + else if( code == 0x42 ) + { + return DenyReason.PSTN_NOT_VALID; + } + else if( code == 0x50 ) + { + return CALL_TIMEOUT; + } + else if( code == 0x51 ) + { + return LANDLINE_TERMINATED_CALL; + } + else if( code == 0x52 ) + { + return SUBSCRIBER_UNIT_TERMINATED_CALL; + } + else if( code == 0x5F ) + { + return DenyReason.CALL_PREEMPTED; + } + else if( code == 0x60 ) + { + return SITE_ACCESS_DENIAL; + } + else if( code == 0xF0 ) + { + return CALL_OPTIONS_NOT_VALID_FOR_SERVICE; + } + else if( code == 0xF1 ) + { + return PROTECTION_SERVICE_OPTION_NOT_VALID; + } + else if( code == 0xF2 ) + { + return DenyReason.DUPLEX_SERVICE_OPTION_NOT_VALID; + } + else if( code == 0xF3 ) + { + return CIRCUIT_OR_PACKET_MODE_OPTION_NOT_VALID; + } + else if( code <= 0x5E ) + { + return DenyReason.RESERVED; + } + else if( code >= 0x61 ) + { + return DenyReason.USER_OR_SYSTEM_DEFINED; + } + + return UNKNOWN; + } +} diff --git a/src/module/decode/p25/reference/Digit.java b/src/main/java/io/github/dsheirer/module/decode/p25/reference/Digit.java similarity index 93% rename from src/module/decode/p25/reference/Digit.java rename to src/main/java/io/github/dsheirer/module/decode/p25/reference/Digit.java index 88ea0448..7e2e2231 100644 --- a/src/module/decode/p25/reference/Digit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/reference/Digit.java @@ -1,81 +1,81 @@ -package module.decode.p25.reference; - -import java.util.List; - -public enum Digit -{ - D0( "0", "A" ), - D1( "1", "B" ), - D2( "2", "C" ), - D3( "3", "D" ), - D4( "4", "-" ), - D5( "5", "-" ), - D6( "6", "-" ), - D7( "7", "-" ), - D8( "8", "-" ), - D9( "9", "-" ), - D10( "*", "-" ), - D11( "#", "-" ), - D12( "-", "-" ), - D13( "HOOK FLASH", "-" ), - D14( "PAUSE", "-" ), - D15( "ESC", "NULL" ), - DUNK( "?", "?" ); - - private String mValue; - private String mEscapedValue; - - private Digit( String value, String escapedValue ) - { - mValue = value; - mEscapedValue = escapedValue; - } - - public String getValue() - { - return mValue; - } - - public String getEscapedValue() - { - return mEscapedValue; - } - - public static Digit fromValue( int value ) - { - if( 0 <= value && value <= 15 ) - { - return values()[ value ]; - } - - return DUNK; - } - - public static String decode( List values ) - { - StringBuilder sb = new StringBuilder(); - - boolean escape = false; - - for( Integer value: values ) - { - Digit d = Digit.fromValue( value ); - - if( d == Digit.D15 ) - { - escape = true; - } - else if( escape ) - { - sb.append( d.getEscapedValue() ); - escape = false; - } - else - { - sb.append( d.getValue() ); - } - } - - return sb.toString(); - } -} +package io.github.dsheirer.module.decode.p25.reference; + +import java.util.List; + +public enum Digit +{ + D0( "0", "A" ), + D1( "1", "B" ), + D2( "2", "C" ), + D3( "3", "D" ), + D4( "4", "-" ), + D5( "5", "-" ), + D6( "6", "-" ), + D7( "7", "-" ), + D8( "8", "-" ), + D9( "9", "-" ), + D10( "*", "-" ), + D11( "#", "-" ), + D12( "-", "-" ), + D13( "HOOK FLASH", "-" ), + D14( "PAUSE", "-" ), + D15( "ESC", "NULL" ), + DUNK( "?", "?" ); + + private String mValue; + private String mEscapedValue; + + private Digit( String value, String escapedValue ) + { + mValue = value; + mEscapedValue = escapedValue; + } + + public String getValue() + { + return mValue; + } + + public String getEscapedValue() + { + return mEscapedValue; + } + + public static Digit fromValue( int value ) + { + if( 0 <= value && value <= 15 ) + { + return values()[ value ]; + } + + return DUNK; + } + + public static String decode( List values ) + { + StringBuilder sb = new StringBuilder(); + + boolean escape = false; + + for( Integer value: values ) + { + Digit d = Digit.fromValue( value ); + + if( d == Digit.D15 ) + { + escape = true; + } + else if( escape ) + { + sb.append( d.getEscapedValue() ); + escape = false; + } + else + { + sb.append( d.getValue() ); + } + } + + return sb.toString(); + } +} diff --git a/src/module/decode/p25/reference/Encryption.java b/src/main/java/io/github/dsheirer/module/decode/p25/reference/Encryption.java similarity index 95% rename from src/module/decode/p25/reference/Encryption.java rename to src/main/java/io/github/dsheirer/module/decode/p25/reference/Encryption.java index d23c1e3a..fa547228 100644 --- a/src/module/decode/p25/reference/Encryption.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/reference/Encryption.java @@ -1,4 +1,4 @@ -package module.decode.p25.reference; +package io.github.dsheirer.module.decode.p25.reference; public enum Encryption { diff --git a/src/module/decode/p25/reference/ExtendedFunction.java b/src/main/java/io/github/dsheirer/module/decode/p25/reference/ExtendedFunction.java similarity index 96% rename from src/module/decode/p25/reference/ExtendedFunction.java rename to src/main/java/io/github/dsheirer/module/decode/p25/reference/ExtendedFunction.java index 5a72848f..2a868ea6 100644 --- a/src/module/decode/p25/reference/ExtendedFunction.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/reference/ExtendedFunction.java @@ -1,4 +1,4 @@ -package module.decode.p25.reference; +package io.github.dsheirer.module.decode.p25.reference; public enum ExtendedFunction { diff --git a/src/module/decode/p25/reference/IPHeaderCompression.java b/src/main/java/io/github/dsheirer/module/decode/p25/reference/IPHeaderCompression.java similarity index 91% rename from src/module/decode/p25/reference/IPHeaderCompression.java rename to src/main/java/io/github/dsheirer/module/decode/p25/reference/IPHeaderCompression.java index d275d466..67dbe7e2 100644 --- a/src/module/decode/p25/reference/IPHeaderCompression.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/reference/IPHeaderCompression.java @@ -1,4 +1,4 @@ -package module.decode.p25.reference; +package io.github.dsheirer.module.decode.p25.reference; public enum IPHeaderCompression { diff --git a/src/module/decode/p25/reference/IPProtocol.java b/src/main/java/io/github/dsheirer/module/decode/p25/reference/IPProtocol.java similarity index 98% rename from src/module/decode/p25/reference/IPProtocol.java rename to src/main/java/io/github/dsheirer/module/decode/p25/reference/IPProtocol.java index b1884eb8..865d3f0b 100644 --- a/src/module/decode/p25/reference/IPProtocol.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/reference/IPProtocol.java @@ -1,4 +1,4 @@ -package module.decode.p25.reference; +package io.github.dsheirer.module.decode.p25.reference; public enum IPProtocol { diff --git a/src/module/decode/p25/reference/LinkControlOpcode.java b/src/main/java/io/github/dsheirer/module/decode/p25/reference/LinkControlOpcode.java similarity index 98% rename from src/module/decode/p25/reference/LinkControlOpcode.java rename to src/main/java/io/github/dsheirer/module/decode/p25/reference/LinkControlOpcode.java index c81474b2..18e14ecd 100644 --- a/src/module/decode/p25/reference/LinkControlOpcode.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/reference/LinkControlOpcode.java @@ -1,4 +1,4 @@ -package module.decode.p25.reference; +package io.github.dsheirer.module.decode.p25.reference; public enum LinkControlOpcode { diff --git a/src/module/decode/p25/reference/MDPConfigurationOption.java b/src/main/java/io/github/dsheirer/module/decode/p25/reference/MDPConfigurationOption.java similarity index 91% rename from src/module/decode/p25/reference/MDPConfigurationOption.java rename to src/main/java/io/github/dsheirer/module/decode/p25/reference/MDPConfigurationOption.java index 979f5b48..c800707a 100644 --- a/src/module/decode/p25/reference/MDPConfigurationOption.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/reference/MDPConfigurationOption.java @@ -1,4 +1,4 @@ -package module.decode.p25.reference; +package io.github.dsheirer.module.decode.p25.reference; public enum MDPConfigurationOption { diff --git a/src/module/decode/p25/reference/Opcode.java b/src/main/java/io/github/dsheirer/module/decode/p25/reference/Opcode.java similarity index 99% rename from src/module/decode/p25/reference/Opcode.java rename to src/main/java/io/github/dsheirer/module/decode/p25/reference/Opcode.java index d94afec8..14b31c3b 100644 --- a/src/module/decode/p25/reference/Opcode.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/reference/Opcode.java @@ -1,4 +1,4 @@ -package module.decode.p25.reference; +package io.github.dsheirer.module.decode.p25.reference; public enum Opcode { diff --git a/src/module/decode/p25/reference/P25NetworkCallsign.java b/src/main/java/io/github/dsheirer/module/decode/p25/reference/P25NetworkCallsign.java similarity index 95% rename from src/module/decode/p25/reference/P25NetworkCallsign.java rename to src/main/java/io/github/dsheirer/module/decode/p25/reference/P25NetworkCallsign.java index c2e80860..cc4a8a96 100644 --- a/src/module/decode/p25/reference/P25NetworkCallsign.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/reference/P25NetworkCallsign.java @@ -1,4 +1,4 @@ -package module.decode.p25.reference; +package io.github.dsheirer.module.decode.p25.reference; public class P25NetworkCallsign { diff --git a/src/module/decode/p25/reference/PDUFormat.java b/src/main/java/io/github/dsheirer/module/decode/p25/reference/PDUFormat.java similarity index 95% rename from src/module/decode/p25/reference/PDUFormat.java rename to src/main/java/io/github/dsheirer/module/decode/p25/reference/PDUFormat.java index e2541b8d..f10155b7 100644 --- a/src/module/decode/p25/reference/PDUFormat.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/reference/PDUFormat.java @@ -1,4 +1,4 @@ -package module.decode.p25.reference; +package io.github.dsheirer.module.decode.p25.reference; public enum PDUFormat { diff --git a/src/module/decode/p25/reference/PDUType.java b/src/main/java/io/github/dsheirer/module/decode/p25/reference/PDUType.java similarity index 96% rename from src/module/decode/p25/reference/PDUType.java rename to src/main/java/io/github/dsheirer/module/decode/p25/reference/PDUType.java index 3ff65849..2066dc25 100644 --- a/src/module/decode/p25/reference/PDUType.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/reference/PDUType.java @@ -1,4 +1,4 @@ -package module.decode.p25.reference; +package io.github.dsheirer.module.decode.p25.reference; public enum PDUType { diff --git a/src/module/decode/p25/reference/QueuedResponseReason.java b/src/main/java/io/github/dsheirer/module/decode/p25/reference/QueuedResponseReason.java similarity index 94% rename from src/module/decode/p25/reference/QueuedResponseReason.java rename to src/main/java/io/github/dsheirer/module/decode/p25/reference/QueuedResponseReason.java index b5de14dd..6d34a2c2 100644 --- a/src/module/decode/p25/reference/QueuedResponseReason.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/reference/QueuedResponseReason.java @@ -1,69 +1,69 @@ -package module.decode.p25.reference; - -public enum QueuedResponseReason -{ - RESERVED( 0x00 ), - REQUESTING_UNIT_BUSY_OTHER_SERVICE( 0x10 ), - TARGET_UNIT_BUSY_OTHER_SERVICE( 0x20 ), - TARGET_UNIT_QUEUED_THIS_CALL( 0x2F ), - TARGET_GROUP_CURRENTLY_ACTIVE( 0x30 ), - CHANNEL_RESOURCES_UNAVAILABLE( 0x40 ), - TELEPHONE_RESOURCES_UNAVAILABLE( 0x41 ), - DATA_RESOURCES_UNAVAILABLE( 0x42 ), - SUPERSEDING_SERVICE_CURRENTLY_ACTIVE( 0x50 ), - USER_OR_SYSTEM_DEFINED( 0x80 ), - UNKNOWN( -1 ); - - private int mCode; - - private QueuedResponseReason( int code ) - { - mCode = code; - } - - public static QueuedResponseReason fromCode( int code ) - { - if( code == 0x10 ) - { - return QueuedResponseReason.REQUESTING_UNIT_BUSY_OTHER_SERVICE; - } - else if( code == 0x20 ) - { - return QueuedResponseReason.TARGET_UNIT_BUSY_OTHER_SERVICE; - } - else if( code == 0x2F ) - { - return QueuedResponseReason.TARGET_UNIT_QUEUED_THIS_CALL; - } - else if( code == 0x30 ) - { - return QueuedResponseReason.TARGET_GROUP_CURRENTLY_ACTIVE; - } - else if( code == 0x40 ) - { - return QueuedResponseReason.CHANNEL_RESOURCES_UNAVAILABLE; - } - else if( code == 0x41 ) - { - return QueuedResponseReason.TELEPHONE_RESOURCES_UNAVAILABLE; - } - else if( code == 0x42 ) - { - return QueuedResponseReason.DATA_RESOURCES_UNAVAILABLE; - } - else if( code == 0x50 ) - { - return QueuedResponseReason.SUPERSEDING_SERVICE_CURRENTLY_ACTIVE; - } - else if( code <= 0x7F ) - { - return QueuedResponseReason.RESERVED; - } - else if( code >= 0x80 ) - { - return QueuedResponseReason.USER_OR_SYSTEM_DEFINED; - } - - return UNKNOWN; - } -} +package io.github.dsheirer.module.decode.p25.reference; + +public enum QueuedResponseReason +{ + RESERVED( 0x00 ), + REQUESTING_UNIT_BUSY_OTHER_SERVICE( 0x10 ), + TARGET_UNIT_BUSY_OTHER_SERVICE( 0x20 ), + TARGET_UNIT_QUEUED_THIS_CALL( 0x2F ), + TARGET_GROUP_CURRENTLY_ACTIVE( 0x30 ), + CHANNEL_RESOURCES_UNAVAILABLE( 0x40 ), + TELEPHONE_RESOURCES_UNAVAILABLE( 0x41 ), + DATA_RESOURCES_UNAVAILABLE( 0x42 ), + SUPERSEDING_SERVICE_CURRENTLY_ACTIVE( 0x50 ), + USER_OR_SYSTEM_DEFINED( 0x80 ), + UNKNOWN( -1 ); + + private int mCode; + + private QueuedResponseReason( int code ) + { + mCode = code; + } + + public static QueuedResponseReason fromCode( int code ) + { + if( code == 0x10 ) + { + return QueuedResponseReason.REQUESTING_UNIT_BUSY_OTHER_SERVICE; + } + else if( code == 0x20 ) + { + return QueuedResponseReason.TARGET_UNIT_BUSY_OTHER_SERVICE; + } + else if( code == 0x2F ) + { + return QueuedResponseReason.TARGET_UNIT_QUEUED_THIS_CALL; + } + else if( code == 0x30 ) + { + return QueuedResponseReason.TARGET_GROUP_CURRENTLY_ACTIVE; + } + else if( code == 0x40 ) + { + return QueuedResponseReason.CHANNEL_RESOURCES_UNAVAILABLE; + } + else if( code == 0x41 ) + { + return QueuedResponseReason.TELEPHONE_RESOURCES_UNAVAILABLE; + } + else if( code == 0x42 ) + { + return QueuedResponseReason.DATA_RESOURCES_UNAVAILABLE; + } + else if( code == 0x50 ) + { + return QueuedResponseReason.SUPERSEDING_SERVICE_CURRENTLY_ACTIVE; + } + else if( code <= 0x7F ) + { + return QueuedResponseReason.RESERVED; + } + else if( code >= 0x80 ) + { + return QueuedResponseReason.USER_OR_SYSTEM_DEFINED; + } + + return UNKNOWN; + } +} diff --git a/src/module/decode/p25/reference/Response.java b/src/main/java/io/github/dsheirer/module/decode/p25/reference/Response.java similarity index 79% rename from src/module/decode/p25/reference/Response.java rename to src/main/java/io/github/dsheirer/module/decode/p25/reference/Response.java index 31c7e521..1dddcf3d 100644 --- a/src/module/decode/p25/reference/Response.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/reference/Response.java @@ -1,4 +1,4 @@ -package module.decode.p25.reference; +package io.github.dsheirer.module.decode.p25.reference; public enum Response { diff --git a/src/module/decode/p25/reference/SNDCPActivationRejectReason.java b/src/main/java/io/github/dsheirer/module/decode/p25/reference/SNDCPActivationRejectReason.java similarity index 92% rename from src/module/decode/p25/reference/SNDCPActivationRejectReason.java rename to src/main/java/io/github/dsheirer/module/decode/p25/reference/SNDCPActivationRejectReason.java index 210c4030..722da47f 100644 --- a/src/module/decode/p25/reference/SNDCPActivationRejectReason.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/reference/SNDCPActivationRejectReason.java @@ -1,53 +1,53 @@ -package module.decode.p25.reference; - -public enum SNDCPActivationRejectReason -{ - R0( 0, "ANY REASON" ), - R1( 1, "MRC NOT PROVISIONED FOR TDS" ), - R2( 2, "MRC DSUT NOT SUPPORTED" ), - R3( 3, "MAX TDS CONTEXTS EXCEEDED" ), - R4( 4, "SNDCP VERSION NOT SUPPORTED" ), - R5( 5, "TDS NOT SUPPORTED BY FNE" ), - R6( 6, "TDS NOT SUPPORTED BY THIS SYSTEM" ), - R7( 7, "IPV4 STATIC ADDRESS NOT CORRECT" ), - R8( 8, "IPV4 STATIC ADDRESS NOT ALLOWED" ), - R9( 9, "IPV4 STATIC ADDRESS IN USE" ), - R10( 10, "IPV4 NOT SUPPORTED" ), - R11( 11, "IPV4 DYNAMIC ADDRESS POOL EMPTY" ), - R12( 12, "IPV4 DYNAMIC ADDRESS NOT SUPPORTED" ), - UNKNOWN( -1, "UNKNOWN" ); - - private int mValue; - public String mLabel; - - private SNDCPActivationRejectReason( int value, String label ) - { - mValue = value; - mLabel = label; - } - - public int getValue() - { - return mValue; - } - - public String getLabel() - { - return mLabel; - } - - public String toString() - { - return getLabel(); - } - - public static SNDCPActivationRejectReason fromValue( int value ) - { - if( 0 <= value && value <= 12 ) - { - return values()[ value ]; - } - - return UNKNOWN; - } -} +package io.github.dsheirer.module.decode.p25.reference; + +public enum SNDCPActivationRejectReason +{ + R0( 0, "ANY REASON" ), + R1( 1, "MRC NOT PROVISIONED FOR TDS" ), + R2( 2, "MRC DSUT NOT SUPPORTED" ), + R3( 3, "MAX TDS CONTEXTS EXCEEDED" ), + R4( 4, "SNDCP VERSION NOT SUPPORTED" ), + R5( 5, "TDS NOT SUPPORTED BY FNE" ), + R6( 6, "TDS NOT SUPPORTED BY THIS SYSTEM" ), + R7( 7, "IPV4 STATIC ADDRESS NOT CORRECT" ), + R8( 8, "IPV4 STATIC ADDRESS NOT ALLOWED" ), + R9( 9, "IPV4 STATIC ADDRESS IN USE" ), + R10( 10, "IPV4 NOT SUPPORTED" ), + R11( 11, "IPV4 DYNAMIC ADDRESS POOL EMPTY" ), + R12( 12, "IPV4 DYNAMIC ADDRESS NOT SUPPORTED" ), + UNKNOWN( -1, "UNKNOWN" ); + + private int mValue; + public String mLabel; + + private SNDCPActivationRejectReason( int value, String label ) + { + mValue = value; + mLabel = label; + } + + public int getValue() + { + return mValue; + } + + public String getLabel() + { + return mLabel; + } + + public String toString() + { + return getLabel(); + } + + public static SNDCPActivationRejectReason fromValue( int value ) + { + if( 0 <= value && value <= 12 ) + { + return values()[ value ]; + } + + return UNKNOWN; + } +} diff --git a/src/module/decode/p25/reference/Service.java b/src/main/java/io/github/dsheirer/module/decode/p25/reference/Service.java similarity index 96% rename from src/module/decode/p25/reference/Service.java rename to src/main/java/io/github/dsheirer/module/decode/p25/reference/Service.java index 56995f20..0bc82cf1 100644 --- a/src/module/decode/p25/reference/Service.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/reference/Service.java @@ -1,4 +1,4 @@ -package module.decode.p25.reference; +package io.github.dsheirer.module.decode.p25.reference; import java.util.ArrayList; import java.util.List; diff --git a/src/module/decode/p25/reference/ServiceAccessPoint.java b/src/main/java/io/github/dsheirer/module/decode/p25/reference/ServiceAccessPoint.java similarity index 97% rename from src/module/decode/p25/reference/ServiceAccessPoint.java rename to src/main/java/io/github/dsheirer/module/decode/p25/reference/ServiceAccessPoint.java index ea1c735d..e133aeb3 100644 --- a/src/module/decode/p25/reference/ServiceAccessPoint.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/reference/ServiceAccessPoint.java @@ -1,4 +1,4 @@ -package module.decode.p25.reference; +package io.github.dsheirer.module.decode.p25.reference; public enum ServiceAccessPoint { diff --git a/src/module/decode/p25/reference/StackOperation.java b/src/main/java/io/github/dsheirer/module/decode/p25/reference/StackOperation.java similarity index 80% rename from src/module/decode/p25/reference/StackOperation.java rename to src/main/java/io/github/dsheirer/module/decode/p25/reference/StackOperation.java index e6250f33..1fecaef1 100644 --- a/src/module/decode/p25/reference/StackOperation.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/reference/StackOperation.java @@ -1,4 +1,4 @@ -package module.decode.p25.reference; +package io.github.dsheirer.module.decode.p25.reference; public enum StackOperation { diff --git a/src/module/decode/p25/reference/Status.java b/src/main/java/io/github/dsheirer/module/decode/p25/reference/Status.java similarity index 79% rename from src/module/decode/p25/reference/Status.java rename to src/main/java/io/github/dsheirer/module/decode/p25/reference/Status.java index 581bb188..0e4bc163 100644 --- a/src/module/decode/p25/reference/Status.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/reference/Status.java @@ -1,4 +1,4 @@ -package module.decode.p25.reference; +package io.github.dsheirer.module.decode.p25.reference; public enum Status { diff --git a/src/module/decode/p25/reference/Vendor.java b/src/main/java/io/github/dsheirer/module/decode/p25/reference/Vendor.java similarity index 99% rename from src/module/decode/p25/reference/Vendor.java rename to src/main/java/io/github/dsheirer/module/decode/p25/reference/Vendor.java index ea521380..4d295893 100644 --- a/src/module/decode/p25/reference/Vendor.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/reference/Vendor.java @@ -1,4 +1,4 @@ -package module.decode.p25.reference; +package io.github.dsheirer.module.decode.p25.reference; public enum Vendor { diff --git a/src/module/decode/p25/reference/VendorLinkControlOpcode.java b/src/main/java/io/github/dsheirer/module/decode/p25/reference/VendorLinkControlOpcode.java similarity index 98% rename from src/module/decode/p25/reference/VendorLinkControlOpcode.java rename to src/main/java/io/github/dsheirer/module/decode/p25/reference/VendorLinkControlOpcode.java index 8607d5c8..e5fbc7e9 100644 --- a/src/module/decode/p25/reference/VendorLinkControlOpcode.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/reference/VendorLinkControlOpcode.java @@ -1,4 +1,4 @@ -package module.decode.p25.reference; +package io.github.dsheirer.module.decode.p25.reference; public enum VendorLinkControlOpcode { diff --git a/src/main/java/io/github/dsheirer/module/decode/passport/DecodeConfigPassport.java b/src/main/java/io/github/dsheirer/module/decode/passport/DecodeConfigPassport.java new file mode 100644 index 00000000..85bb4b0a --- /dev/null +++ b/src/main/java/io/github/dsheirer/module/decode/passport/DecodeConfigPassport.java @@ -0,0 +1,34 @@ +/* + * ********************************************************************************************************************* + * 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 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 + * ********************************************************************************************************************* + */ +package io.github.dsheirer.module.decode.passport; + +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.module.decode.config.DecodeConfiguration; + +public class DecodeConfigPassport extends DecodeConfiguration +{ + public DecodeConfigPassport() + { + } + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + public DecoderType getDecoderType() + { + return DecoderType.PASSPORT; + } +} diff --git a/src/module/decode/passport/PassportBand.java b/src/main/java/io/github/dsheirer/module/decode/passport/PassportBand.java similarity index 97% rename from src/module/decode/passport/PassportBand.java rename to src/main/java/io/github/dsheirer/module/decode/passport/PassportBand.java index 0a7613c7..f855ff63 100644 --- a/src/module/decode/passport/PassportBand.java +++ b/src/main/java/io/github/dsheirer/module/decode/passport/PassportBand.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.passport; +package io.github.dsheirer.module.decode.passport; public enum PassportBand diff --git a/src/module/decode/passport/PassportCallEvent.java b/src/main/java/io/github/dsheirer/module/decode/passport/PassportCallEvent.java similarity index 90% rename from src/module/decode/passport/PassportCallEvent.java rename to src/main/java/io/github/dsheirer/module/decode/passport/PassportCallEvent.java index 1165d0c8..40fc6b12 100644 --- a/src/module/decode/passport/PassportCallEvent.java +++ b/src/main/java/io/github/dsheirer/module/decode/passport/PassportCallEvent.java @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.passport; +package io.github.dsheirer.module.decode.passport; -import module.decode.DecoderType; -import module.decode.event.CallEvent; -import alias.Alias; -import alias.AliasList; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.module.decode.event.CallEvent; public class PassportCallEvent extends CallEvent { @@ -35,14 +35,14 @@ public class PassportCallEvent extends CallEvent long frequency, String details ) { - super( DecoderType.PASSPORT, callEventType, + super( DecoderType.PASSPORT, callEventType, aliasList, fromID, toID, details ); mChannel = channel; mFrequency = frequency; } - private Alias getAlias( String talkgroup ) + private Alias getAlias(String talkgroup ) { if( hasAliasList() ) { diff --git a/src/module/decode/passport/PassportDecoder.java b/src/main/java/io/github/dsheirer/module/decode/passport/PassportDecoder.java similarity index 77% rename from src/module/decode/passport/PassportDecoder.java rename to src/main/java/io/github/dsheirer/module/decode/passport/PassportDecoder.java index 859e7c9d..72ba45a2 100644 --- a/src/module/decode/passport/PassportDecoder.java +++ b/src/main/java/io/github/dsheirer/module/decode/passport/PassportDecoder.java @@ -15,28 +15,27 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.passport; +package io.github.dsheirer.module.decode.passport; -import instrument.Instrumentable; -import instrument.tap.Tap; -import instrument.tap.TapGroup; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.MessageFramer; +import io.github.dsheirer.bits.SyncPattern; +import io.github.dsheirer.dsp.fsk.LTRFSKDecoder; +import io.github.dsheirer.instrument.Instrumentable; +import io.github.dsheirer.instrument.tap.Tap; +import io.github.dsheirer.instrument.tap.TapGroup; +import io.github.dsheirer.module.decode.Decoder; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.module.decode.config.DecodeConfiguration; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.IUnFilteredRealBufferListener; +import io.github.dsheirer.sample.real.RealBuffer; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ScheduledExecutorService; -import module.decode.Decoder; -import module.decode.DecoderType; -import module.decode.config.DecodeConfiguration; -import sample.Listener; -import sample.real.IUnFilteredRealBufferListener; -import sample.real.RealBuffer; -import alias.AliasList; -import bits.MessageFramer; -import bits.SyncPattern; -import dsp.fsk.LTRFSKDecoder; - -public class PassportDecoder extends Decoder +public class PassportDecoder extends Decoder implements IUnFilteredRealBufferListener, Instrumentable { public static final int PASSPORT_MESSAGE_LENGTH = 68; @@ -52,7 +51,7 @@ public class PassportDecoder extends Decoder * Passport Decoder. Decodes unfiltered (e.g. demodulated but with no DC or * audio filtering) samples and produces Passport messages. */ - public PassportDecoder( DecodeConfiguration config, AliasList aliasList ) + public PassportDecoder(DecodeConfiguration config, AliasList aliasList ) { mPassportFSKDecoder = new LTRFSKDecoder(); diff --git a/src/module/decode/passport/PassportDecoderEditor.java b/src/main/java/io/github/dsheirer/module/decode/passport/PassportDecoderEditor.java similarity index 92% rename from src/module/decode/passport/PassportDecoderEditor.java rename to src/main/java/io/github/dsheirer/module/decode/passport/PassportDecoderEditor.java index e40dd11a..47f2e2cc 100644 --- a/src/module/decode/passport/PassportDecoderEditor.java +++ b/src/main/java/io/github/dsheirer/module/decode/passport/PassportDecoderEditor.java @@ -15,23 +15,20 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.passport; +package io.github.dsheirer.module.decode.passport; -import gui.editor.Editor; -import gui.editor.EditorValidationException; -import gui.editor.ValidatingEditor; +import io.github.dsheirer.controller.channel.Channel; +import io.github.dsheirer.gui.editor.Editor; +import io.github.dsheirer.gui.editor.EditorValidationException; +import io.github.dsheirer.gui.editor.ValidatingEditor; +import io.github.dsheirer.module.decode.config.DecodeConfiguration; +import net.miginfocom.swing.MigLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.JCheckBox; -import javax.swing.JSlider; +import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; - -import module.decode.config.DecodeConfiguration; -import net.miginfocom.swing.MigLayout; -import controller.channel.Channel; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; public class PassportDecoderEditor extends ValidatingEditor { diff --git a/src/module/decode/passport/PassportDecoderState.java b/src/main/java/io/github/dsheirer/module/decode/passport/PassportDecoderState.java similarity index 93% rename from src/module/decode/passport/PassportDecoderState.java rename to src/main/java/io/github/dsheirer/module/decode/passport/PassportDecoderState.java index ee5370e7..1174224e 100644 --- a/src/module/decode/passport/PassportDecoderState.java +++ b/src/main/java/io/github/dsheirer/module/decode/passport/PassportDecoderState.java @@ -16,22 +16,21 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.passport; +package io.github.dsheirer.module.decode.passport; -import alias.Alias; -import alias.AliasList; -import alias.id.AliasIDType; -import channel.metadata.AliasedStringAttributeMonitor; -import channel.metadata.Attribute; -import channel.metadata.AttributeChangeRequest; -import channel.state.DecoderState; -import channel.state.DecoderStateEvent; -import channel.state.DecoderStateEvent.Event; -import channel.state.State; -import message.Message; -import module.decode.DecoderType; -import module.decode.event.CallEvent; -import module.decode.event.CallEvent.CallEventType; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.alias.id.AliasIDType; +import io.github.dsheirer.channel.metadata.AliasedStringAttributeMonitor; +import io.github.dsheirer.channel.metadata.Attribute; +import io.github.dsheirer.channel.metadata.AttributeChangeRequest; +import io.github.dsheirer.channel.state.DecoderState; +import io.github.dsheirer.channel.state.DecoderStateEvent; +import io.github.dsheirer.channel.state.DecoderStateEvent.Event; +import io.github.dsheirer.channel.state.State; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.module.decode.event.CallEvent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -45,8 +44,7 @@ import java.util.concurrent.ScheduledExecutorService; public class PassportDecoderState extends DecoderState { - private final static Logger mLog = - LoggerFactory.getLogger(PassportDecoderState.class); + private final static Logger mLog = LoggerFactory.getLogger(PassportDecoderState.class); private HashSet mTalkgroupsFirstHeard = new HashSet(); private TreeSet mTalkgroups = new TreeSet(); @@ -166,7 +164,7 @@ public class PassportDecoderState extends DecoderState if(mCurrentCallEvent == null) { mCurrentCallEvent = new PassportCallEvent - .Builder(CallEventType.CALL) + .Builder(CallEvent.CallEventType.CALL) .aliasList(getAliasList()) .channel(String.valueOf(mChannelNumber)) .frequency(passport.getLCNFrequency()) @@ -196,7 +194,7 @@ public class PassportDecoderState extends DecoderState mActiveCalls.put(lcn, tg); broadcast(new PassportCallEvent - .Builder(CallEventType.CALL_DETECT) + .Builder(CallEvent.CallEventType.CALL_DETECT) .aliasList(getAliasList()) .channel(String.valueOf(lcn)) .details("Site: " + passport.getSite()) @@ -258,7 +256,7 @@ public class PassportDecoderState extends DecoderState if(mCurrentCallEvent == null) { mCurrentCallEvent = new PassportCallEvent - .Builder(CallEventType.DATA_CALL) + .Builder(CallEvent.CallEventType.DATA_CALL) .aliasList(getAliasList()) .channel(String.valueOf(mChannelNumber)) .frequency(passport.getLCNFrequency()) @@ -288,7 +286,7 @@ public class PassportDecoderState extends DecoderState mActiveCalls.put(lcn, tg); broadcast(new PassportCallEvent - .Builder(CallEventType.DATA_CALL) + .Builder(CallEvent.CallEventType.DATA_CALL) .aliasList(getAliasList()) .channel(String.valueOf(lcn)) .details("Site: " + passport.getSite()) @@ -338,10 +336,10 @@ public class PassportDecoderState extends DecoderState break; case RA_REGI: if(mCurrentCallEvent == null || - mCurrentCallEvent.getCallEventType() != CallEventType.REGISTER) + mCurrentCallEvent.getCallEventType() != CallEvent.CallEventType.REGISTER) { mCurrentCallEvent = new PassportCallEvent - .Builder(CallEventType.REGISTER) + .Builder(CallEvent.CallEventType.REGISTER) .aliasList(getAliasList()) .channel(String.valueOf(passport.getLCN())) .frequency(passport.getLCNFrequency()) diff --git a/src/module/decode/passport/PassportMessage.java b/src/main/java/io/github/dsheirer/module/decode/passport/PassportMessage.java similarity index 96% rename from src/module/decode/passport/PassportMessage.java rename to src/main/java/io/github/dsheirer/module/decode/passport/PassportMessage.java index 4d7d8d54..cfaf1331 100644 --- a/src/module/decode/passport/PassportMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/passport/PassportMessage.java @@ -15,24 +15,24 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.passport; +package io.github.dsheirer.module.decode.passport; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRC; +import io.github.dsheirer.edac.CRCPassport; +import io.github.dsheirer.map.Plottable; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.message.MessageType; +import io.github.dsheirer.module.decode.DecoderType; + import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.List; -import map.Plottable; -import message.Message; -import message.MessageType; -import module.decode.DecoderType; -import alias.Alias; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRC; -import edac.CRCPassport; - public class PassportMessage extends Message { private static final String sUNKNOWN = "**UNKNOWN**"; @@ -613,7 +613,7 @@ public class PassportMessage extends Message } /** - * Provides a listing of aliases contained in the message. + * Provides a listing of aliases contained in the message. */ public List getAliases() { diff --git a/src/module/decode/passport/PassportMessageFilter.java b/src/main/java/io/github/dsheirer/module/decode/passport/PassportMessageFilter.java similarity index 88% rename from src/module/decode/passport/PassportMessageFilter.java rename to src/main/java/io/github/dsheirer/module/decode/passport/PassportMessageFilter.java index 6be05f84..ee98e88a 100644 --- a/src/module/decode/passport/PassportMessageFilter.java +++ b/src/main/java/io/github/dsheirer/module/decode/passport/PassportMessageFilter.java @@ -1,14 +1,14 @@ -package module.decode.passport; +package io.github.dsheirer.module.decode.passport; + +import io.github.dsheirer.filter.Filter; +import io.github.dsheirer.filter.FilterElement; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.message.MessageType; import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import message.Message; -import message.MessageType; -import filter.Filter; -import filter.FilterElement; - public class PassportMessageFilter extends Filter { private HashMap> mElements = diff --git a/src/module/decode/passport/PassportMessageProcessor.java b/src/main/java/io/github/dsheirer/module/decode/passport/PassportMessageProcessor.java similarity index 90% rename from src/module/decode/passport/PassportMessageProcessor.java rename to src/main/java/io/github/dsheirer/module/decode/passport/PassportMessageProcessor.java index 553e5a35..ddce69b7 100644 --- a/src/module/decode/passport/PassportMessageProcessor.java +++ b/src/main/java/io/github/dsheirer/module/decode/passport/PassportMessageProcessor.java @@ -15,16 +15,16 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.passport; +package io.github.dsheirer.module.decode.passport; + +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.message.MessageType; +import io.github.dsheirer.sample.Listener; import java.util.HashMap; -import message.Message; -import message.MessageType; -import sample.Listener; -import alias.AliasList; -import bits.BinaryMessage; - public class PassportMessageProcessor implements Listener { private Listener mMessageListener; diff --git a/src/module/decode/tait/Tait1200ANIMessage.java b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200ANIMessage.java similarity index 95% rename from src/module/decode/tait/Tait1200ANIMessage.java rename to src/main/java/io/github/dsheirer/module/decode/tait/Tait1200ANIMessage.java index b6347997..9bcc471d 100644 --- a/src/module/decode/tait/Tait1200ANIMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200ANIMessage.java @@ -15,23 +15,21 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.tait; +package io.github.dsheirer.module.decode.tait; + +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRC; +import io.github.dsheirer.map.Plottable; +import io.github.dsheirer.message.Message; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.List; -import map.Plottable; -import message.Message; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import alias.Alias; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRC; - public class Tait1200ANIMessage extends Message { private final static Logger mLog = LoggerFactory.getLogger( Tait1200ANIMessage.class ); @@ -249,7 +247,7 @@ public class Tait1200ANIMessage extends Message } /** - * Provides a listing of aliases contained in the message. + * Provides a listing of aliases contained in the message. */ public List getAliases() { diff --git a/src/module/decode/tait/Tait1200ANIMessageProcessor.java b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200ANIMessageProcessor.java similarity index 89% rename from src/module/decode/tait/Tait1200ANIMessageProcessor.java rename to src/main/java/io/github/dsheirer/module/decode/tait/Tait1200ANIMessageProcessor.java index 34a1a9df..d384ad28 100644 --- a/src/module/decode/tait/Tait1200ANIMessageProcessor.java +++ b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200ANIMessageProcessor.java @@ -15,17 +15,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.tait; - -import message.Message; +package io.github.dsheirer.module.decode.tait; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.sample.Listener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; -import alias.AliasList; -import bits.BinaryMessage; - public class Tait1200ANIMessageProcessor implements Listener { private final static Logger mLog = diff --git a/src/module/decode/tait/Tait1200CallEvent.java b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200CallEvent.java similarity index 91% rename from src/module/decode/tait/Tait1200CallEvent.java rename to src/main/java/io/github/dsheirer/module/decode/tait/Tait1200CallEvent.java index 90bd6c53..e6a53d70 100644 --- a/src/module/decode/tait/Tait1200CallEvent.java +++ b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200CallEvent.java @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.tait; +package io.github.dsheirer.module.decode.tait; -import module.decode.DecoderType; -import module.decode.event.CallEvent; -import alias.Alias; -import alias.AliasList; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.module.decode.event.CallEvent; public class Tait1200CallEvent extends CallEvent { @@ -30,7 +30,7 @@ public class Tait1200CallEvent extends CallEvent String toID, String details ) { - super( DecoderType.TAIT_1200, callEventType, + super( DecoderType.TAIT_1200, callEventType, aliasList, fromID, toID, details ); } diff --git a/src/module/decode/tait/Tait1200Decoder.java b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200Decoder.java similarity index 83% rename from src/module/decode/tait/Tait1200Decoder.java rename to src/main/java/io/github/dsheirer/module/decode/tait/Tait1200Decoder.java index 97b9b788..9ccae831 100644 --- a/src/module/decode/tait/Tait1200Decoder.java +++ b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200Decoder.java @@ -15,34 +15,33 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.tait; +package io.github.dsheirer.module.decode.tait; -import instrument.Instrumentable; -import instrument.tap.Tap; -import instrument.tap.TapGroup; -import instrument.tap.stream.BinaryTap; -import instrument.tap.stream.FloatBufferTap; -import instrument.tap.stream.FloatTap; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.MessageFramer; +import io.github.dsheirer.bits.SyncPattern; +import io.github.dsheirer.dsp.filter.Filters; +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.dsp.fsk.FSK2Decoder; +import io.github.dsheirer.dsp.fsk.FSK2Decoder.Output; +import io.github.dsheirer.instrument.Instrumentable; +import io.github.dsheirer.instrument.tap.Tap; +import io.github.dsheirer.instrument.tap.TapGroup; +import io.github.dsheirer.instrument.tap.stream.BinaryTap; +import io.github.dsheirer.instrument.tap.stream.FloatBufferTap; +import io.github.dsheirer.instrument.tap.stream.FloatTap; +import io.github.dsheirer.module.decode.Decoder; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.sample.Broadcaster; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.IFilteredRealBufferListener; +import io.github.dsheirer.sample.real.RealBuffer; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ScheduledExecutorService; -import module.decode.Decoder; -import module.decode.DecoderType; -import sample.Broadcaster; -import sample.Listener; -import sample.real.IFilteredRealBufferListener; -import sample.real.RealBuffer; -import alias.AliasList; -import bits.MessageFramer; -import bits.SyncPattern; -import dsp.filter.Filters; -import dsp.filter.fir.real.RealFIRFilter_RB_RB; -import dsp.filter.halfband.real.HalfBandFilter_RB_RB; -import dsp.fsk.FSK2Decoder; -import dsp.fsk.FSK2Decoder.Output; - /** * TAIT 1200 - 1200 baud 2FSK decoder */ diff --git a/src/module/decode/tait/Tait1200DecoderState.java b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200DecoderState.java similarity index 85% rename from src/module/decode/tait/Tait1200DecoderState.java rename to src/main/java/io/github/dsheirer/module/decode/tait/Tait1200DecoderState.java index b18ccb24..44367d23 100644 --- a/src/module/decode/tait/Tait1200DecoderState.java +++ b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200DecoderState.java @@ -16,23 +16,23 @@ * along with this program. If not, see * ******************************************************************************/ -package module.decode.tait; +package io.github.dsheirer.module.decode.tait; -import alias.Alias; -import alias.AliasList; -import alias.id.AliasIDType; -import channel.metadata.AliasedStringAttributeMonitor; -import channel.metadata.Attribute; -import channel.metadata.AttributeChangeRequest; -import channel.state.DecoderState; -import channel.state.DecoderStateEvent; -import channel.state.DecoderStateEvent.Event; -import channel.state.State; -import message.Message; -import module.decode.DecoderType; -import module.decode.event.CallEvent.CallEventType; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.alias.id.AliasIDType; +import io.github.dsheirer.channel.metadata.AliasedStringAttributeMonitor; +import io.github.dsheirer.channel.metadata.Attribute; +import io.github.dsheirer.channel.metadata.AttributeChangeRequest; +import io.github.dsheirer.channel.state.DecoderState; +import io.github.dsheirer.channel.state.DecoderStateEvent; +import io.github.dsheirer.channel.state.DecoderStateEvent.Event; +import io.github.dsheirer.channel.state.State; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.module.decode.event.CallEvent; +import io.github.dsheirer.util.StringUtils; import org.jdesktop.swingx.mapviewer.GeoPosition; -import util.StringUtils; import java.util.ArrayList; import java.util.Collections; @@ -114,7 +114,7 @@ public class Tait1200DecoderState extends DecoderState setMessageType("GPS"); - broadcast(new Tait1200CallEvent(CallEventType.GPS, getAliasList(), + broadcast(new Tait1200CallEvent(CallEvent.CallEventType.GPS, getAliasList(), gps.getFromID(), gps.getToID(), gps.getGPSLocation().toString())); broadcast(new DecoderStateEvent(this, Event.DECODE, State.DATA)); @@ -131,7 +131,7 @@ public class Tait1200DecoderState extends DecoderState setMessage(null); setMessageType("ANI"); - broadcast(new Tait1200CallEvent(CallEventType.ID_ANI, getAliasList(), + broadcast(new Tait1200CallEvent(CallEvent.CallEventType.ID_ANI, getAliasList(), ani.getFromID(), ani.getToID(), "ANI")); broadcast(new DecoderStateEvent(this, Event.DECODE, State.CALL)); diff --git a/src/module/decode/tait/Tait1200GPSMessage.java b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200GPSMessage.java similarity index 97% rename from src/module/decode/tait/Tait1200GPSMessage.java rename to src/main/java/io/github/dsheirer/module/decode/tait/Tait1200GPSMessage.java index 990341cc..6158f1c6 100644 --- a/src/module/decode/tait/Tait1200GPSMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200GPSMessage.java @@ -15,7 +15,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.tait; +package io.github.dsheirer.module.decode.tait; + +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.edac.CRC; +import io.github.dsheirer.map.Plottable; +import io.github.dsheirer.message.Message; +import org.jdesktop.swingx.mapviewer.GeoPosition; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -25,18 +35,6 @@ import java.util.GregorianCalendar; import java.util.List; import java.util.TimeZone; -import map.Plottable; -import message.Message; - -import org.jdesktop.swingx.mapviewer.GeoPosition; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import alias.Alias; -import alias.AliasList; -import bits.BinaryMessage; -import edac.CRC; - public class Tait1200GPSMessage extends Message { private final static Logger mLog = LoggerFactory.getLogger( Tait1200GPSMessage.class ); @@ -390,7 +388,7 @@ public class Tait1200GPSMessage extends Message } /** - * Provides a listing of aliases contained in the message. + * Provides a listing of aliases contained in the message. */ public List getAliases() { diff --git a/src/module/decode/tait/Tait1200GPSMessageProcessor.java b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200GPSMessageProcessor.java similarity index 88% rename from src/module/decode/tait/Tait1200GPSMessageProcessor.java rename to src/main/java/io/github/dsheirer/module/decode/tait/Tait1200GPSMessageProcessor.java index 2d8d732a..c9bf06ef 100644 --- a/src/module/decode/tait/Tait1200GPSMessageProcessor.java +++ b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200GPSMessageProcessor.java @@ -15,17 +15,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.tait; - -import message.Message; +package io.github.dsheirer.module.decode.tait; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.sample.Listener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; -import alias.AliasList; -import bits.BinaryMessage; - public class Tait1200GPSMessageProcessor implements Listener { private final static Logger mLog = diff --git a/src/module/decode/tait/Tait1200MessageFilter.java b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200MessageFilter.java similarity index 89% rename from src/module/decode/tait/Tait1200MessageFilter.java rename to src/main/java/io/github/dsheirer/module/decode/tait/Tait1200MessageFilter.java index 70d9e4cd..72677dac 100644 --- a/src/module/decode/tait/Tait1200MessageFilter.java +++ b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200MessageFilter.java @@ -15,15 +15,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.decode.tait; +package io.github.dsheirer.module.decode.tait; + +import io.github.dsheirer.filter.Filter; +import io.github.dsheirer.filter.FilterElement; +import io.github.dsheirer.message.Message; import java.util.Collections; import java.util.List; -import message.Message; -import filter.Filter; -import filter.FilterElement; - public class Tait1200MessageFilter extends Filter { diff --git a/src/module/demodulate/am/AMDemodulatorModule.java b/src/main/java/io/github/dsheirer/module/demodulate/am/AMDemodulatorModule.java similarity index 80% rename from src/module/demodulate/am/AMDemodulatorModule.java rename to src/main/java/io/github/dsheirer/module/demodulate/am/AMDemodulatorModule.java index 374491aa..b52cd0eb 100644 --- a/src/module/demodulate/am/AMDemodulatorModule.java +++ b/src/main/java/io/github/dsheirer/module/demodulate/am/AMDemodulatorModule.java @@ -15,24 +15,24 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.demodulate.am; +package io.github.dsheirer.module.demodulate.am; + +import io.github.dsheirer.dsp.am.AMDemodulator_CB; +import io.github.dsheirer.dsp.filter.FilterFactory; +import io.github.dsheirer.dsp.filter.Window.WindowType; +import io.github.dsheirer.dsp.filter.fir.complex.ComplexFIRFilter_CB_CB; +import io.github.dsheirer.dsp.filter.fir.real.RealFIRFilter_RB_RB; +import io.github.dsheirer.dsp.gain.AutomaticGainControl_RB; +import io.github.dsheirer.module.Module; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.ComplexBuffer; +import io.github.dsheirer.sample.complex.IComplexBufferListener; +import io.github.dsheirer.sample.real.IFilteredRealBufferProvider; +import io.github.dsheirer.sample.real.RealBuffer; import java.util.concurrent.ScheduledExecutorService; -import module.Module; -import sample.Listener; -import sample.complex.ComplexBuffer; -import sample.complex.IComplexBufferListener; -import sample.real.IFilteredRealBufferProvider; -import sample.real.RealBuffer; -import dsp.am.AMDemodulator_CB; -import dsp.filter.FilterFactory; -import dsp.filter.Window.WindowType; -import dsp.filter.fir.complex.ComplexFIRFilter_CB_CB; -import dsp.filter.fir.real.RealFIRFilter_RB_RB; -import dsp.gain.AutomaticGainControl_RB; - -public class AMDemodulatorModule extends Module +public class AMDemodulatorModule extends Module implements IComplexBufferListener, IFilteredRealBufferProvider { private static final int SAMPLE_RATE = 48000; diff --git a/src/module/demodulate/audio/DemodulatedAudioFilterModule.java b/src/main/java/io/github/dsheirer/module/demodulate/audio/DemodulatedAudioFilterModule.java similarity index 84% rename from src/module/demodulate/audio/DemodulatedAudioFilterModule.java rename to src/main/java/io/github/dsheirer/module/demodulate/audio/DemodulatedAudioFilterModule.java index 4efb3d8b..b583605a 100644 --- a/src/module/demodulate/audio/DemodulatedAudioFilterModule.java +++ b/src/main/java/io/github/dsheirer/module/demodulate/audio/DemodulatedAudioFilterModule.java @@ -16,19 +16,19 @@ * along with this program. If not, see * ******************************************************************************/ -package module.demodulate.audio; +package io.github.dsheirer.module.demodulate.audio; -import dsp.filter.FilterFactory; -import dsp.filter.Window.WindowType; -import dsp.filter.dc.DCRemovalFilter_RealBuffer; -import dsp.filter.fir.real.RealFIRFilter_RB_RB; -import module.Module; +import io.github.dsheirer.dsp.filter.FilterFactory; +import io.github.dsheirer.dsp.filter.Window.WindowType; +import io.github.dsheirer.dsp.filter.dc.DCRemovalFilter_RealBuffer; +import io.github.dsheirer.dsp.filter.fir.real.RealFIRFilter_RB_RB; +import io.github.dsheirer.module.Module; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.IFilteredRealBufferProvider; +import io.github.dsheirer.sample.real.IUnFilteredRealBufferListener; +import io.github.dsheirer.sample.real.RealBuffer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; -import sample.real.IFilteredRealBufferProvider; -import sample.real.IUnFilteredRealBufferListener; -import sample.real.RealBuffer; import java.util.concurrent.ScheduledExecutorService; diff --git a/src/module/demodulate/fm/FMDemodulatorModule.java b/src/main/java/io/github/dsheirer/module/demodulate/fm/FMDemodulatorModule.java similarity index 82% rename from src/module/demodulate/fm/FMDemodulatorModule.java rename to src/main/java/io/github/dsheirer/module/demodulate/fm/FMDemodulatorModule.java index 8b7646de..e94bffd4 100644 --- a/src/module/demodulate/fm/FMDemodulatorModule.java +++ b/src/main/java/io/github/dsheirer/module/demodulate/fm/FMDemodulatorModule.java @@ -15,20 +15,20 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.demodulate.fm; +package io.github.dsheirer.module.demodulate.fm; -import dsp.filter.FilterFactory; -import dsp.filter.Window.WindowType; -import dsp.filter.fir.complex.ComplexFIRFilter_CB_CB; -import dsp.fm.FMDemodulator_CB; -import module.Module; +import io.github.dsheirer.dsp.filter.FilterFactory; +import io.github.dsheirer.dsp.filter.Window; +import io.github.dsheirer.dsp.filter.fir.complex.ComplexFIRFilter_CB_CB; +import io.github.dsheirer.dsp.fm.FMDemodulator_CB; +import io.github.dsheirer.module.Module; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.ComplexBuffer; +import io.github.dsheirer.sample.complex.IComplexBufferListener; +import io.github.dsheirer.sample.real.IUnFilteredRealBufferProvider; +import io.github.dsheirer.sample.real.RealBuffer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; -import sample.complex.ComplexBuffer; -import sample.complex.IComplexBufferListener; -import sample.real.IUnFilteredRealBufferProvider; -import sample.real.RealBuffer; import java.util.concurrent.ScheduledExecutorService; @@ -56,7 +56,7 @@ public class FMDemodulatorModule extends Module implements IComplexBufferListene assert (stop > pass); mIQFilter = new ComplexFIRFilter_CB_CB(FilterFactory.getLowPass( - SAMPLE_RATE, pass, stop, 60, WindowType.HAMMING, true), 1.0f); + SAMPLE_RATE, pass, stop, 60, Window.WindowType.HAMMING, true), 1.0f); mDemodulator = new FMDemodulator_CB(1.0f); mIQFilter.setListener(mDemodulator); diff --git a/src/module/log/CallEventLogger.java b/src/main/java/io/github/dsheirer/module/log/CallEventLogger.java similarity index 88% rename from src/module/log/CallEventLogger.java rename to src/main/java/io/github/dsheirer/module/log/CallEventLogger.java index a3e5ab14..2f9784f2 100644 --- a/src/module/log/CallEventLogger.java +++ b/src/main/java/io/github/dsheirer/module/log/CallEventLogger.java @@ -15,14 +15,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.log; +package io.github.dsheirer.module.log; + +import io.github.dsheirer.module.decode.event.CallEvent; +import io.github.dsheirer.module.decode.event.ICallEventListener; +import io.github.dsheirer.sample.Listener; import java.nio.file.Path; -import module.decode.event.CallEvent; -import module.decode.event.ICallEventListener; -import sample.Listener; - public class CallEventLogger extends EventLogger implements ICallEventListener, Listener { diff --git a/src/module/log/EventLogConfigurationEditor.java b/src/main/java/io/github/dsheirer/module/log/EventLogConfigurationEditor.java similarity index 94% rename from src/module/log/EventLogConfigurationEditor.java rename to src/main/java/io/github/dsheirer/module/log/EventLogConfigurationEditor.java index 9ecdf68e..9e9dc0d3 100644 --- a/src/module/log/EventLogConfigurationEditor.java +++ b/src/main/java/io/github/dsheirer/module/log/EventLogConfigurationEditor.java @@ -15,20 +15,18 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.log; +package io.github.dsheirer.module.log; -import gui.editor.Editor; +import io.github.dsheirer.controller.channel.Channel; +import io.github.dsheirer.gui.editor.Editor; +import io.github.dsheirer.module.log.config.EventLogConfiguration; +import net.miginfocom.swing.MigLayout; +import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.List; -import javax.swing.JCheckBox; - -import module.log.config.EventLogConfiguration; -import net.miginfocom.swing.MigLayout; -import controller.channel.Channel; - public class EventLogConfigurationEditor extends Editor { private static final long serialVersionUID = 1L; diff --git a/src/module/log/EventLogManager.java b/src/main/java/io/github/dsheirer/module/log/EventLogManager.java similarity index 79% rename from src/module/log/EventLogManager.java rename to src/main/java/io/github/dsheirer/module/log/EventLogManager.java index 3595f18e..74d29363 100644 --- a/src/module/log/EventLogManager.java +++ b/src/main/java/io/github/dsheirer/module/log/EventLogManager.java @@ -16,14 +16,13 @@ * along with this program. If not, see * ******************************************************************************/ -package module.log; +package io.github.dsheirer.module.log; -import module.Module; -import module.log.MessageEventLogger.Type; -import module.log.config.EventLogConfiguration; +import io.github.dsheirer.module.Module; +import io.github.dsheirer.module.log.config.EventLogConfiguration; +import io.github.dsheirer.properties.SystemProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import properties.SystemProperties; import java.nio.file.Path; import java.util.ArrayList; @@ -41,7 +40,7 @@ public class EventLogManager .getApplicationFolder( "event_logs" ); } - public List getLoggers( EventLogConfiguration config, String prefix ) + public List getLoggers(EventLogConfiguration config, String prefix ) { List loggers = new ArrayList(); @@ -64,9 +63,9 @@ public class EventLogManager switch( eventLogType ) { case BINARY_MESSAGE: - return new MessageEventLogger( mDirectory, sb.toString(), Type.BINARY ); + return new MessageEventLogger( mDirectory, sb.toString(), MessageEventLogger.Type.BINARY ); case DECODED_MESSAGE: - return new MessageEventLogger( mDirectory, sb.toString(), Type.DECODED ); + return new MessageEventLogger( mDirectory, sb.toString(), MessageEventLogger.Type.DECODED ); case CALL_EVENT: return new CallEventLogger( mDirectory, sb.toString() ); default: diff --git a/src/module/log/EventLogType.java b/src/main/java/io/github/dsheirer/module/log/EventLogType.java similarity index 97% rename from src/module/log/EventLogType.java rename to src/main/java/io/github/dsheirer/module/log/EventLogType.java index 6c8287fd..534e4677 100644 --- a/src/module/log/EventLogType.java +++ b/src/main/java/io/github/dsheirer/module/log/EventLogType.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.log; +package io.github.dsheirer.module.log; public enum EventLogType diff --git a/src/module/log/EventLogger.java b/src/main/java/io/github/dsheirer/module/log/EventLogger.java similarity index 96% rename from src/module/log/EventLogger.java rename to src/main/java/io/github/dsheirer/module/log/EventLogger.java index 3eeb4a97..b4099cde 100644 --- a/src/module/log/EventLogger.java +++ b/src/main/java/io/github/dsheirer/module/log/EventLogger.java @@ -16,12 +16,12 @@ * along with this program. If not, see * ******************************************************************************/ -package module.log; +package io.github.dsheirer.module.log; -import module.Module; +import io.github.dsheirer.module.Module; +import io.github.dsheirer.util.TimeStamp; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import util.TimeStamp; import java.io.File; import java.io.FileNotFoundException; diff --git a/src/module/log/MessageEventLogger.java b/src/main/java/io/github/dsheirer/module/log/MessageEventLogger.java similarity index 89% rename from src/module/log/MessageEventLogger.java rename to src/main/java/io/github/dsheirer/module/log/MessageEventLogger.java index de021df7..0d1f6b14 100644 --- a/src/module/log/MessageEventLogger.java +++ b/src/main/java/io/github/dsheirer/module/log/MessageEventLogger.java @@ -15,15 +15,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package module.log; +package io.github.dsheirer.module.log; + +import io.github.dsheirer.message.IMessageListener; +import io.github.dsheirer.message.Message; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.util.TimeStamp; import java.nio.file.Path; -import message.IMessageListener; -import message.Message; -import sample.Listener; -import util.TimeStamp; - public class MessageEventLogger extends EventLogger implements IMessageListener, Listener { diff --git a/src/main/java/io/github/dsheirer/module/log/config/EventLogConfiguration.java b/src/main/java/io/github/dsheirer/module/log/config/EventLogConfiguration.java new file mode 100644 index 00000000..49c02094 --- /dev/null +++ b/src/main/java/io/github/dsheirer/module/log/config/EventLogConfiguration.java @@ -0,0 +1,59 @@ +/******************************************************************************* + * 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 + ******************************************************************************/ +package io.github.dsheirer.module.log.config; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +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.log.EventLogType; + +import java.util.ArrayList; +import java.util.List; + +@JsonSubTypes.Type(value = EventLogConfiguration.class, name = "eventLogConfiguration") +@JacksonXmlRootElement(localName = "event_log_configuration") +public class EventLogConfiguration extends Configuration +{ + protected List mLoggers = new ArrayList(); + + public EventLogConfiguration() + { + } + + @JacksonXmlProperty(isAttribute = false, localName = "logger") + public List getLoggers() + { + return mLoggers; + } + + public void setLoggers(ArrayList loggers) + { + mLoggers = loggers; + } + + public void addLogger(EventLogType logger) + { + mLoggers.add(logger); + } + + public void clear() + { + mLoggers.clear(); + } +} diff --git a/src/playlist/PlaylistManager.java b/src/main/java/io/github/dsheirer/playlist/PlaylistManager.java similarity index 78% rename from src/playlist/PlaylistManager.java rename to src/main/java/io/github/dsheirer/playlist/PlaylistManager.java index 6ca21ecf..472ce4f1 100644 --- a/src/playlist/PlaylistManager.java +++ b/src/main/java/io/github/dsheirer/playlist/PlaylistManager.java @@ -1,43 +1,41 @@ -/******************************************************************************* - * SDR Trunk - * Copyright (C) 2014-2017 Dennis Sheirer +/* + * ********************************************************************************************************************* + * 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 - ******************************************************************************/ -package playlist; + * You should have received a copy of the GNU General Public License along with this program. + * If not, see + * ********************************************************************************************************************* + */ +package io.github.dsheirer.playlist; -import alias.AliasEvent; -import alias.AliasModel; -import audio.broadcast.BroadcastEvent; -import audio.broadcast.BroadcastModel; -import controller.channel.Channel.ChannelType; -import controller.channel.ChannelEvent; -import controller.channel.ChannelEventListener; -import controller.channel.ChannelModel; -import controller.channel.map.ChannelMapEvent; -import controller.channel.map.ChannelMapModel; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.dataformat.xml.JacksonXmlModule; +import com.fasterxml.jackson.dataformat.xml.XmlMapper; +import io.github.dsheirer.alias.AliasEvent; +import io.github.dsheirer.alias.AliasModel; +import io.github.dsheirer.audio.broadcast.BroadcastEvent; +import io.github.dsheirer.audio.broadcast.BroadcastModel; +import io.github.dsheirer.controller.channel.Channel.ChannelType; +import io.github.dsheirer.controller.channel.ChannelEvent; +import io.github.dsheirer.controller.channel.ChannelEventListener; +import io.github.dsheirer.controller.channel.ChannelModel; +import io.github.dsheirer.controller.channel.map.ChannelMapEvent; +import io.github.dsheirer.controller.channel.map.ChannelMapModel; +import io.github.dsheirer.properties.SystemProperties; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.util.ThreadPool; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import playlist.version1.PlaylistConverterV1ToV2; -import properties.SystemProperties; -import sample.Listener; -import util.ThreadPool; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Marshaller; -import javax.xml.bind.Unmarshaller; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -137,33 +135,7 @@ public class PlaylistManager implements ChannelEventListener public void init() { PlaylistV2 playlist = load(); - - boolean saveRequired = false; - - if(playlist == null) - { - mLog.info("Couldn't find version 2 playlist - looking for version 1 playlist to convert"); - - Path playlistV1Path = getPlaylistFolderPath().resolve("playlist.xml"); - - PlaylistConverterV1ToV2 converter = new PlaylistConverterV1ToV2(playlistV1Path); - - if(converter.hasErrorMessages()) - { - mLog.error("Playlist version 1 conversion errors: " + converter.getErrorMessages()); - } - - playlist = converter.getConvertedPlaylist(); - - saveRequired = true; - } - transferPlaylistToModels(playlist); - - if(saveRequired) - { - schedulePlaylistSave(); - } } /** @@ -297,8 +269,6 @@ public class PlaylistManager implements ChannelEventListener playlist.setChannels(mChannelModel.getChannels()); playlist.setChannelMaps(mChannelMapModel.getChannelMaps()); - JAXBContext context = null; - //Create a backup copy of the current playlist if(Files.exists(getPlaylistPath())) { @@ -329,14 +299,11 @@ public class PlaylistManager implements ChannelEventListener try(OutputStream out = Files.newOutputStream(getPlaylistPath())) { - context = JAXBContext.newInstance(PlaylistV2.class); - - Marshaller m = context.createMarshaller(); - - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); - - m.marshal(playlist, out); - + JacksonXmlModule xmlModule = new JacksonXmlModule(); + xmlModule.setDefaultUseWrapper(false); + ObjectMapper objectMapper = new XmlMapper(xmlModule); + objectMapper.enable(SerializationFeature.INDENT_OUTPUT); + objectMapper.writeValue(out, playlist); out.flush(); //Remove the playlist lock file to indicate that we successfully saved the file @@ -345,11 +312,6 @@ public class PlaylistManager implements ChannelEventListener Files.delete(getPlaylistLockPath()); } } - catch(JAXBException je) - { - mLog.error("JAXB exception while serializing the playlist to a file [" + getPlaylistPath().toString() + - "]", je); - } catch(IOException ioe) { mLog.error("IO error while writing the playlist to a file [" + getPlaylistPath().toString() + "]", ioe); @@ -395,19 +357,13 @@ public class PlaylistManager implements ChannelEventListener if(Files.exists(getPlaylistPath())) { - JAXBContext context = null; + JacksonXmlModule xmlModule = new JacksonXmlModule(); + xmlModule.setDefaultUseWrapper(false); + ObjectMapper objectMapper = new XmlMapper(xmlModule); try(InputStream in = Files.newInputStream(getPlaylistPath())) { - context = JAXBContext.newInstance(PlaylistV2.class); - - Unmarshaller m = context.createUnmarshaller(); - - playlist = (PlaylistV2) m.unmarshal(in); - } - catch(JAXBException je) - { - mLog.error("JAXB exception while loading/unmarshalling playlist", je); + playlist = objectMapper.readValue(in, PlaylistV2.class); } catch(IOException ioe) { diff --git a/src/main/java/io/github/dsheirer/playlist/PlaylistV2.java b/src/main/java/io/github/dsheirer/playlist/PlaylistV2.java new file mode 100644 index 00000000..f132ca3b --- /dev/null +++ b/src/main/java/io/github/dsheirer/playlist/PlaylistV2.java @@ -0,0 +1,85 @@ +/******************************************************************************* + * 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 + ******************************************************************************/ +package io.github.dsheirer.playlist; + +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.audio.broadcast.BroadcastConfiguration; +import io.github.dsheirer.controller.channel.Channel; +import io.github.dsheirer.controller.channel.map.ChannelMap; + +import java.util.ArrayList; +import java.util.List; + +@JacksonXmlRootElement(localName = "playlist") +public class PlaylistV2 +{ + private List mAliases = new ArrayList<>(); + private List mBroadcastConfigurations = new ArrayList<>(); + private List mChannels = new ArrayList<>(); + private List mChannelMaps = new ArrayList<>(); + + public PlaylistV2() + { + } + + @JacksonXmlProperty(isAttribute = false, localName = "alias") + public List getAliases() + { + return mAliases; + } + + public void setAliases(List aliases) + { + mAliases = aliases; + } + + @JacksonXmlProperty(isAttribute = false, localName = "channel") + public List getChannels() + { + return mChannels; + } + + public void setChannels(List channels) + { + mChannels = channels; + } + + @JacksonXmlProperty(isAttribute = false, localName = "channel_map") + public List getChannelMaps() + { + return mChannelMaps; + } + + public void setChannelMaps(List channelMaps) + { + mChannelMaps = channelMaps; + } + + @JacksonXmlProperty(isAttribute = false, localName = "stream") + public List getBroadcastConfigurations() + { + return mBroadcastConfigurations; + } + + public void setBroadcastConfigurations(List configurations) + { + mBroadcastConfigurations = configurations; + } +} diff --git a/src/properties/SystemProperties.java b/src/main/java/io/github/dsheirer/properties/SystemProperties.java similarity index 84% rename from src/properties/SystemProperties.java rename to src/main/java/io/github/dsheirer/properties/SystemProperties.java index c34d2a0d..fd4bc75c 100644 --- a/src/properties/SystemProperties.java +++ b/src/main/java/io/github/dsheirer/properties/SystemProperties.java @@ -16,26 +16,27 @@ * along with this program. If not, see * ******************************************************************************/ -package properties; +package io.github.dsheirer.properties; +import io.github.dsheirer.gui.SDRTrunk; +import io.github.dsheirer.util.ThreadPool; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import util.ThreadPool; import java.awt.*; -import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; -import java.io.InputStreamReader; import java.io.OutputStream; +import java.net.URL; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Properties; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; +import java.util.jar.Manifest; /** * SystemProperties - provides an isolated instance of properties for the application @@ -46,6 +47,7 @@ public class SystemProperties private static String DEFAULT_APP_ROOT = "SDRTrunk"; private static String PROPERTIES_FILENAME = "SDRTrunk.properties"; + private static String MANIFEST_VERSION = "Implementation-Version"; private static SystemProperties INSTANCE; private static Properties mProperties; @@ -84,6 +86,32 @@ public class SystemProperties } } + /** + * Get the Manifest for the jar that contains the specified class + * @param clz contained in a jar + * @return manifest from the containing jar + */ + public static Manifest getManifest(Class clz) + { + String resource = "/" + clz.getName().replace(".", "/") + ".class"; + String fullPath = clz.getResource(resource).toString(); + String archivePath = fullPath.substring(0, fullPath.length() - resource.length()); + if (archivePath.endsWith("\\WEB-INF\\classes") || archivePath.endsWith("/WEB-INF/classes")) { + archivePath = archivePath.substring(0, archivePath.length() - "/WEB-INF/classes".length()); // Required for wars + } + + try (InputStream input = new URL(archivePath + "/META-INF/MANIFEST.MF").openStream()) + { + return new Manifest(input); + } + catch (Exception e) + { + mLog.error("Unable to load jar manifest - we're probably not running from a release jar"); + } + + return null; + } + /** * Application root directory. Normally returns "SDRTRunk" from the user's * home directory, unless that has been changed to another location on the @@ -164,6 +192,9 @@ public class SystemProperties mLog.info("SystemProperties - loaded [" + propertiesPath.toString() + "]"); } + /** + * Creates the application name, suitable for display in the title bar of the gui + */ public String getApplicationName() { if(mApplicationName == null) @@ -172,22 +203,18 @@ public class SystemProperties sb.append("sdrtrunk"); - try(BufferedReader reader = new BufferedReader( - new InputStreamReader(this.getClass() - .getResourceAsStream("/sdrtrunk-version")))) + Manifest manifest = getManifest(SDRTrunk.class); + + if(manifest != null) { - String version = reader.readLine(); + String version = manifest.getMainAttributes().getValue(MANIFEST_VERSION); if(version != null) { - sb.append(" V"); + sb.append(" v"); sb.append(version); } } - catch(Exception e) - { - mLog.error("Couldn't read sdrtrunk version from application jar file"); - } mApplicationName = sb.toString(); } diff --git a/src/external/radioreference/RadioReferenceService.java b/src/main/java/io/github/dsheirer/radioreference/RadioReferenceService.java similarity index 98% rename from src/external/radioreference/RadioReferenceService.java rename to src/main/java/io/github/dsheirer/radioreference/RadioReferenceService.java index 12eefcea..36cea61c 100644 --- a/src/external/radioreference/RadioReferenceService.java +++ b/src/main/java/io/github/dsheirer/radioreference/RadioReferenceService.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package external.radioreference; +package io.github.dsheirer.radioreference; import com.radioreference.api.soap2.AuthInfo; import com.radioreference.api.soap2.RRWsdlLocator; @@ -30,7 +30,6 @@ import org.slf4j.LoggerFactory; import javax.xml.rpc.ServiceException; import java.rmi.RemoteException; import java.text.SimpleDateFormat; -import java.util.Date; public class RadioReferenceService { diff --git a/src/record/AudioRecorder.java b/src/main/java/io/github/dsheirer/record/AudioRecorder.java similarity index 97% rename from src/record/AudioRecorder.java rename to src/main/java/io/github/dsheirer/record/AudioRecorder.java index 15723eba..656b275c 100644 --- a/src/record/AudioRecorder.java +++ b/src/main/java/io/github/dsheirer/record/AudioRecorder.java @@ -16,15 +16,15 @@ * along with this program. If not, see * ******************************************************************************/ -package record; +package io.github.dsheirer.record; -import audio.AudioPacket; -import audio.IAudioPacketListener; -import channel.metadata.Metadata; -import module.Module; +import io.github.dsheirer.audio.AudioPacket; +import io.github.dsheirer.audio.IAudioPacketListener; +import io.github.dsheirer.channel.metadata.Metadata; +import io.github.dsheirer.module.Module; +import io.github.dsheirer.sample.Listener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; import java.io.FileOutputStream; import java.io.IOException; diff --git a/src/record/RecordConfigurationEditor.java b/src/main/java/io/github/dsheirer/record/RecordConfigurationEditor.java similarity index 94% rename from src/record/RecordConfigurationEditor.java rename to src/main/java/io/github/dsheirer/record/RecordConfigurationEditor.java index 832f242e..1dab9ba3 100644 --- a/src/record/RecordConfigurationEditor.java +++ b/src/main/java/io/github/dsheirer/record/RecordConfigurationEditor.java @@ -15,20 +15,18 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package record; +package io.github.dsheirer.record; -import gui.editor.Editor; +import io.github.dsheirer.controller.channel.Channel; +import io.github.dsheirer.gui.editor.Editor; +import io.github.dsheirer.record.config.RecordConfiguration; +import net.miginfocom.swing.MigLayout; +import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.List; -import javax.swing.JCheckBox; - -import net.miginfocom.swing.MigLayout; -import record.config.RecordConfiguration; -import controller.channel.Channel; - public class RecordConfigurationEditor extends Editor { private static final long serialVersionUID = 1L; diff --git a/src/record/Recorder.java b/src/main/java/io/github/dsheirer/record/Recorder.java similarity index 97% rename from src/record/Recorder.java rename to src/main/java/io/github/dsheirer/record/Recorder.java index ba3d8c86..b91663ff 100644 --- a/src/record/Recorder.java +++ b/src/main/java/io/github/dsheirer/record/Recorder.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package record; +package io.github.dsheirer.record; import java.io.IOException; diff --git a/src/record/RecorderManager.java b/src/main/java/io/github/dsheirer/record/RecorderManager.java similarity index 94% rename from src/record/RecorderManager.java rename to src/main/java/io/github/dsheirer/record/RecorderManager.java index 4d9789e0..9486d1e9 100644 --- a/src/record/RecorderManager.java +++ b/src/main/java/io/github/dsheirer/record/RecorderManager.java @@ -15,19 +15,19 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package record; +package io.github.dsheirer.record; -import audio.AudioPacket; -import channel.metadata.Metadata; +import io.github.dsheirer.audio.AudioPacket; +import io.github.dsheirer.channel.metadata.Metadata; +import io.github.dsheirer.properties.SystemProperties; +import io.github.dsheirer.record.wave.ComplexBufferWaveRecorder; +import io.github.dsheirer.record.wave.RealBufferWaveRecorder; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.OverflowableTransferQueue; +import io.github.dsheirer.sample.real.IOverflowListener; +import io.github.dsheirer.util.ThreadPool; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import properties.SystemProperties; -import record.wave.ComplexBufferWaveRecorder; -import record.wave.RealBufferWaveRecorder; -import sample.Listener; -import sample.OverflowableTransferQueue; -import sample.real.IOverflowListener; -import util.ThreadPool; import java.io.File; import java.util.ArrayList; diff --git a/src/record/RecorderType.java b/src/main/java/io/github/dsheirer/record/RecorderType.java similarity index 97% rename from src/record/RecorderType.java rename to src/main/java/io/github/dsheirer/record/RecorderType.java index bb83ba1f..fe294126 100644 --- a/src/record/RecorderType.java +++ b/src/main/java/io/github/dsheirer/record/RecorderType.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package record; +package io.github.dsheirer.record; public enum RecorderType { diff --git a/src/record/config/RecordConfiguration.java b/src/main/java/io/github/dsheirer/record/config/RecordConfiguration.java similarity index 56% rename from src/record/config/RecordConfiguration.java rename to src/main/java/io/github/dsheirer/record/config/RecordConfiguration.java index 5315e878..1cda4aa1 100644 --- a/src/record/config/RecordConfiguration.java +++ b/src/main/java/io/github/dsheirer/record/config/RecordConfiguration.java @@ -1,58 +1,55 @@ /******************************************************************************* * 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 ******************************************************************************/ -package record.config; +package io.github.dsheirer.record.config; + +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.github.dsheirer.controller.config.Configuration; +import io.github.dsheirer.record.RecorderType; import java.util.ArrayList; import java.util.List; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import record.RecorderType; -import controller.config.Configuration; - -@XmlRootElement( name = "record_configuration" ) public class RecordConfiguration extends Configuration { - private List mRecorders = new ArrayList<>(); - - public RecordConfiguration() - { - } + private List mRecorders = new ArrayList<>(); - @XmlElement( name = "recorder" ) - public List getRecorders() - { - return mRecorders; - } - - public void setRecorders( List recorders ) - { - mRecorders = recorders; - } - - public void addRecorder( RecorderType recorder ) - { - mRecorders.add( recorder ); - } + public RecordConfiguration() + { + } - public void clearRecorders() - { - mRecorders.clear(); - } + @JacksonXmlProperty(isAttribute = false, localName = "recorder") + public List getRecorders() + { + return mRecorders; + } + + public void setRecorders(List recorders) + { + mRecorders = recorders; + } + + public void addRecorder(RecorderType recorder) + { + mRecorders.add(recorder); + } + + public void clearRecorders() + { + mRecorders.clear(); + } } diff --git a/src/record/mp3/MP3Recorder.java b/src/main/java/io/github/dsheirer/record/mp3/MP3Recorder.java similarity index 93% rename from src/record/mp3/MP3Recorder.java rename to src/main/java/io/github/dsheirer/record/mp3/MP3Recorder.java index cc9dc7e8..8b4fc892 100644 --- a/src/record/mp3/MP3Recorder.java +++ b/src/main/java/io/github/dsheirer/record/mp3/MP3Recorder.java @@ -16,13 +16,13 @@ * along with this program. If not, see * ******************************************************************************/ -package record.mp3; +package io.github.dsheirer.record.mp3; -import audio.AudioPacket; -import audio.convert.MP3AudioConverter; +import io.github.dsheirer.audio.AudioPacket; +import io.github.dsheirer.audio.convert.MP3AudioConverter; +import io.github.dsheirer.record.AudioRecorder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import record.AudioRecorder; import java.io.IOException; import java.io.OutputStream; diff --git a/src/record/wave/AudioPacketMonoWaveReader.java b/src/main/java/io/github/dsheirer/record/wave/AudioPacketMonoWaveReader.java similarity index 88% rename from src/record/wave/AudioPacketMonoWaveReader.java rename to src/main/java/io/github/dsheirer/record/wave/AudioPacketMonoWaveReader.java index 11463fa2..c6f2e21f 100644 --- a/src/record/wave/AudioPacketMonoWaveReader.java +++ b/src/main/java/io/github/dsheirer/record/wave/AudioPacketMonoWaveReader.java @@ -16,13 +16,13 @@ * along with this program. If not, see * ******************************************************************************/ -package record.wave; +package io.github.dsheirer.record.wave; -import audio.AudioPacket; -import audio.IAudioPacketListener; -import channel.metadata.Metadata; -import sample.Listener; -import sample.real.RealBuffer; +import io.github.dsheirer.audio.AudioPacket; +import io.github.dsheirer.audio.IAudioPacketListener; +import io.github.dsheirer.channel.metadata.Metadata; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.RealBuffer; import java.io.IOException; import java.nio.file.Path; diff --git a/src/record/wave/ComplexBufferWaveRecorder.java b/src/main/java/io/github/dsheirer/record/wave/ComplexBufferWaveRecorder.java similarity index 91% rename from src/record/wave/ComplexBufferWaveRecorder.java rename to src/main/java/io/github/dsheirer/record/wave/ComplexBufferWaveRecorder.java index f738bc7f..ef6de826 100644 --- a/src/record/wave/ComplexBufferWaveRecorder.java +++ b/src/main/java/io/github/dsheirer/record/wave/ComplexBufferWaveRecorder.java @@ -15,8 +15,19 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package record.wave; +package io.github.dsheirer.record.wave; +import io.github.dsheirer.module.Module; +import io.github.dsheirer.sample.Buffer; +import io.github.dsheirer.sample.ConversionUtils; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.ComplexBuffer; +import io.github.dsheirer.sample.complex.IComplexBufferListener; +import io.github.dsheirer.util.TimeStamp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.sound.sampled.AudioFormat; import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; @@ -26,24 +37,10 @@ import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; -import javax.sound.sampled.AudioFormat; - -import module.Module; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import sample.Buffer; -import sample.ConversionUtils; -import sample.Listener; -import sample.complex.ComplexBuffer; -import sample.complex.IComplexBufferListener; -import util.TimeStamp; - /** * WAVE audio recorder module for recording complex (I&Q) samples to a wave file */ -public class ComplexBufferWaveRecorder extends Module +public class ComplexBufferWaveRecorder extends Module implements IComplexBufferListener, Listener { private final static Logger mLog = @@ -125,7 +122,7 @@ public class ComplexBufferWaveRecorder extends Module if( !success ) { - mLog.error( "recorder buffer overflow - purging [" + + mLog.error( "recorder buffer overflow - purging [" + mFile.toFile().getAbsolutePath() + "]" ); mBuffers.clear(); diff --git a/src/record/wave/MonoWaveReader.java b/src/main/java/io/github/dsheirer/record/wave/MonoWaveReader.java similarity index 97% rename from src/record/wave/MonoWaveReader.java rename to src/main/java/io/github/dsheirer/record/wave/MonoWaveReader.java index a03cf94f..da5d60e8 100644 --- a/src/record/wave/MonoWaveReader.java +++ b/src/main/java/io/github/dsheirer/record/wave/MonoWaveReader.java @@ -16,14 +16,14 @@ * along with this program. If not, see * ******************************************************************************/ -package record.wave; +package io.github.dsheirer.record.wave; +import io.github.dsheirer.sample.ConversionUtils; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.RealBuffer; import org.apache.commons.lang3.Validate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.ConversionUtils; -import sample.Listener; -import sample.real.RealBuffer; import java.io.IOException; import java.io.InputStream; diff --git a/src/record/wave/RealBufferWaveRecorder.java b/src/main/java/io/github/dsheirer/record/wave/RealBufferWaveRecorder.java similarity index 94% rename from src/record/wave/RealBufferWaveRecorder.java rename to src/main/java/io/github/dsheirer/record/wave/RealBufferWaveRecorder.java index 763c9ded..8e6607ad 100644 --- a/src/record/wave/RealBufferWaveRecorder.java +++ b/src/main/java/io/github/dsheirer/record/wave/RealBufferWaveRecorder.java @@ -16,16 +16,16 @@ * along with this program. If not, see * ******************************************************************************/ -package record.wave; +package io.github.dsheirer.record.wave; -import module.Module; +import io.github.dsheirer.module.Module; +import io.github.dsheirer.sample.ConversionUtils; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.IFilteredRealBufferListener; +import io.github.dsheirer.sample.real.RealBuffer; +import io.github.dsheirer.util.TimeStamp; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.ConversionUtils; -import sample.Listener; -import sample.real.IFilteredRealBufferListener; -import sample.real.RealBuffer; -import util.TimeStamp; import javax.sound.sampled.AudioFormat; import java.io.IOException; diff --git a/src/record/wave/WaveUtils.java b/src/main/java/io/github/dsheirer/record/wave/WaveUtils.java similarity index 99% rename from src/record/wave/WaveUtils.java rename to src/main/java/io/github/dsheirer/record/wave/WaveUtils.java index 68fb8d8e..0977aa0d 100644 --- a/src/record/wave/WaveUtils.java +++ b/src/main/java/io/github/dsheirer/record/wave/WaveUtils.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package record.wave; +package io.github.dsheirer.record.wave; import javax.sound.sampled.AudioFormat; import java.nio.ByteBuffer; diff --git a/src/record/wave/WaveWriter.java b/src/main/java/io/github/dsheirer/record/wave/WaveWriter.java similarity index 99% rename from src/record/wave/WaveWriter.java rename to src/main/java/io/github/dsheirer/record/wave/WaveWriter.java index 645cbf5c..f062788d 100644 --- a/src/record/wave/WaveWriter.java +++ b/src/main/java/io/github/dsheirer/record/wave/WaveWriter.java @@ -16,10 +16,11 @@ * along with this program. If not, see * ******************************************************************************/ -package record.wave; +package io.github.dsheirer.record.wave; import org.apache.commons.lang3.Validate; +import javax.sound.sampled.AudioFormat; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; @@ -31,8 +32,6 @@ import java.util.Arrays; import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.sound.sampled.AudioFormat; - public class WaveWriter implements AutoCloseable { private static final Pattern FILENAME_PATTERN = Pattern.compile( "(.*_)(\\d+)(\\.wav)" ); @@ -134,7 +133,7 @@ public class WaveWriter implements AutoCloseable } /** - * Writes the buffer contents to the file. Assumes that the buffer is full + * Writes the buffer contents to the file. Assumes that the buffer is full * and the first byte of data is at position 0. */ public void write( ByteBuffer buffer ) throws IOException @@ -216,7 +215,7 @@ public class WaveWriter implements AutoCloseable } /** - * Creates a little-endian 4-byte buffer containing an unsigned 32-bit + * Creates a little-endian 4-byte buffer containing an unsigned 32-bit * integer value derived from the 4 least significant bytes of the argument. * * The buffer's position is set to 0 to prepare it for writing to a channel. diff --git a/src/sample/Broadcaster.java b/src/main/java/io/github/dsheirer/sample/Broadcaster.java similarity index 98% rename from src/sample/Broadcaster.java rename to src/main/java/io/github/dsheirer/sample/Broadcaster.java index d4f9cce1..92496aad 100644 --- a/src/sample/Broadcaster.java +++ b/src/main/java/io/github/dsheirer/sample/Broadcaster.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package sample; +package io.github.dsheirer.sample; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; diff --git a/src/sample/Buffer.java b/src/main/java/io/github/dsheirer/sample/Buffer.java similarity index 89% rename from src/sample/Buffer.java rename to src/main/java/io/github/dsheirer/sample/Buffer.java index 943fb385..62197e04 100644 --- a/src/sample/Buffer.java +++ b/src/main/java/io/github/dsheirer/sample/Buffer.java @@ -1,4 +1,4 @@ -package sample; +package io.github.dsheirer.sample; public class Buffer { diff --git a/src/sample/BufferOverflow.java b/src/main/java/io/github/dsheirer/sample/BufferOverflow.java similarity index 97% rename from src/sample/BufferOverflow.java rename to src/main/java/io/github/dsheirer/sample/BufferOverflow.java index 847a7559..03d8b7af 100644 --- a/src/sample/BufferOverflow.java +++ b/src/main/java/io/github/dsheirer/sample/BufferOverflow.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package sample; +package io.github.dsheirer.sample; /** * Buffer overflow event. Used for broadcasting overflow events to listeners. diff --git a/src/sample/ConversionUtils.java b/src/main/java/io/github/dsheirer/sample/ConversionUtils.java similarity index 95% rename from src/sample/ConversionUtils.java rename to src/main/java/io/github/dsheirer/sample/ConversionUtils.java index c2e2f6fc..95d72bcb 100644 --- a/src/sample/ConversionUtils.java +++ b/src/main/java/io/github/dsheirer/sample/ConversionUtils.java @@ -1,11 +1,11 @@ -package sample; +package io.github.dsheirer.sample; + +import io.github.dsheirer.sample.real.RealBuffer; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.ShortBuffer; -import sample.real.RealBuffer; - /** * Utilities for converting to/from signed 16-bit sample byte arrays and float buffers */ diff --git a/src/sample/Listener.java b/src/main/java/io/github/dsheirer/sample/Listener.java similarity index 96% rename from src/sample/Listener.java rename to src/main/java/io/github/dsheirer/sample/Listener.java index d462468d..5188a2e2 100644 --- a/src/sample/Listener.java +++ b/src/main/java/io/github/dsheirer/sample/Listener.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package sample; +package io.github.dsheirer.sample; public interface Listener { diff --git a/src/sample/OverflowableTransferQueue.java b/src/main/java/io/github/dsheirer/sample/OverflowableTransferQueue.java similarity index 97% rename from src/sample/OverflowableTransferQueue.java rename to src/main/java/io/github/dsheirer/sample/OverflowableTransferQueue.java index 2deeca07..70d20728 100644 --- a/src/sample/OverflowableTransferQueue.java +++ b/src/main/java/io/github/dsheirer/sample/OverflowableTransferQueue.java @@ -16,12 +16,11 @@ * along with this program. If not, see * ******************************************************************************/ -package sample; +package io.github.dsheirer.sample; +import io.github.dsheirer.sample.real.IOverflowListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.real.IOverflowListener; -import source.tuner.TunerChannelSource; import java.util.Collection; import java.util.concurrent.LinkedTransferQueue; diff --git a/src/sample/Provider.java b/src/main/java/io/github/dsheirer/sample/Provider.java similarity index 96% rename from src/sample/Provider.java rename to src/main/java/io/github/dsheirer/sample/Provider.java index b9ccd5a5..a81136cc 100644 --- a/src/sample/Provider.java +++ b/src/main/java/io/github/dsheirer/sample/Provider.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package sample; +package io.github.dsheirer.sample; public interface Provider { diff --git a/src/sample/SampleType.java b/src/main/java/io/github/dsheirer/sample/SampleType.java similarity index 78% rename from src/sample/SampleType.java rename to src/main/java/io/github/dsheirer/sample/SampleType.java index 09e9196b..f796ee4e 100644 --- a/src/sample/SampleType.java +++ b/src/main/java/io/github/dsheirer/sample/SampleType.java @@ -1,4 +1,4 @@ -package sample; +package io.github.dsheirer.sample; public enum SampleType { diff --git a/src/sample/adapter/ByteSampleAdapter.java b/src/main/java/io/github/dsheirer/sample/adapter/ByteSampleAdapter.java similarity index 97% rename from src/sample/adapter/ByteSampleAdapter.java rename to src/main/java/io/github/dsheirer/sample/adapter/ByteSampleAdapter.java index 17295a3b..9955c1a2 100644 --- a/src/sample/adapter/ByteSampleAdapter.java +++ b/src/main/java/io/github/dsheirer/sample/adapter/ByteSampleAdapter.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package sample.adapter; +package io.github.dsheirer.sample.adapter; public class ByteSampleAdapter implements ISampleAdapter { diff --git a/src/sample/adapter/ChannelShortAdapter.java b/src/main/java/io/github/dsheirer/sample/adapter/ChannelShortAdapter.java similarity index 96% rename from src/sample/adapter/ChannelShortAdapter.java rename to src/main/java/io/github/dsheirer/sample/adapter/ChannelShortAdapter.java index e974f82a..379087b4 100644 --- a/src/sample/adapter/ChannelShortAdapter.java +++ b/src/main/java/io/github/dsheirer/sample/adapter/ChannelShortAdapter.java @@ -15,14 +15,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package sample.adapter; +package io.github.dsheirer.sample.adapter; + +import io.github.dsheirer.source.mixer.MixerChannel; +import org.apache.commons.lang3.Validate; import java.nio.ByteBuffer; import java.nio.ByteOrder; -import org.apache.commons.lang3.Validate; -import source.mixer.MixerChannel; - /** * Converts 16-bit little endian byte data into an array of floats */ diff --git a/src/sample/adapter/ComplexToFloatSampleConverter.java b/src/main/java/io/github/dsheirer/sample/adapter/ComplexToFloatSampleConverter.java similarity index 89% rename from src/sample/adapter/ComplexToFloatSampleConverter.java rename to src/main/java/io/github/dsheirer/sample/adapter/ComplexToFloatSampleConverter.java index 2d90c878..6c013b44 100644 --- a/src/sample/adapter/ComplexToFloatSampleConverter.java +++ b/src/main/java/io/github/dsheirer/sample/adapter/ComplexToFloatSampleConverter.java @@ -15,16 +15,16 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package sample.adapter; +package io.github.dsheirer.sample.adapter; + +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.Complex; +import io.github.dsheirer.source.mixer.MixerChannel; import java.util.List; -import sample.Listener; -import sample.complex.Complex; -import source.mixer.MixerChannel; - /** - * Receives complex samples and send either the left channel or the right + * Receives complex samples and send either the left channel or the right * channel to the short sample listener */ public class ComplexToFloatSampleConverter implements Listener> diff --git a/src/sample/adapter/FloatArrayToComplexAdapter.java b/src/main/java/io/github/dsheirer/sample/adapter/FloatArrayToComplexAdapter.java similarity index 92% rename from src/sample/adapter/FloatArrayToComplexAdapter.java rename to src/main/java/io/github/dsheirer/sample/adapter/FloatArrayToComplexAdapter.java index 9a6abb41..70af8237 100644 --- a/src/sample/adapter/FloatArrayToComplexAdapter.java +++ b/src/main/java/io/github/dsheirer/sample/adapter/FloatArrayToComplexAdapter.java @@ -15,10 +15,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package sample.adapter; +package io.github.dsheirer.sample.adapter; -import sample.Listener; -import sample.complex.Complex; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.Complex; public class FloatArrayToComplexAdapter implements Listener { diff --git a/src/sample/adapter/ISampleAdapter.java b/src/main/java/io/github/dsheirer/sample/adapter/ISampleAdapter.java similarity index 96% rename from src/sample/adapter/ISampleAdapter.java rename to src/main/java/io/github/dsheirer/sample/adapter/ISampleAdapter.java index a1c829bc..ec80a8ae 100644 --- a/src/sample/adapter/ISampleAdapter.java +++ b/src/main/java/io/github/dsheirer/sample/adapter/ISampleAdapter.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package sample.adapter; +package io.github.dsheirer.sample.adapter; /* * Adapter to convert byte data received from a data stream into float[] diff --git a/src/sample/adapter/ShortAdapter.java b/src/main/java/io/github/dsheirer/sample/adapter/ShortAdapter.java similarity index 97% rename from src/sample/adapter/ShortAdapter.java rename to src/main/java/io/github/dsheirer/sample/adapter/ShortAdapter.java index ad8622e8..6faeb20a 100644 --- a/src/sample/adapter/ShortAdapter.java +++ b/src/main/java/io/github/dsheirer/sample/adapter/ShortAdapter.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package sample.adapter; +package io.github.dsheirer.sample.adapter; import java.nio.ByteBuffer; import java.nio.ByteOrder; diff --git a/src/sample/adapter/ShortToFloatMap.java b/src/main/java/io/github/dsheirer/sample/adapter/ShortToFloatMap.java similarity index 85% rename from src/sample/adapter/ShortToFloatMap.java rename to src/main/java/io/github/dsheirer/sample/adapter/ShortToFloatMap.java index c8a07a86..b95f7b03 100644 --- a/src/sample/adapter/ShortToFloatMap.java +++ b/src/main/java/io/github/dsheirer/sample/adapter/ShortToFloatMap.java @@ -1,4 +1,4 @@ -package sample.adapter; +package io.github.dsheirer.sample.adapter; public class ShortToFloatMap { diff --git a/src/sample/adapter/Test.java b/src/main/java/io/github/dsheirer/sample/adapter/Test.java similarity index 79% rename from src/sample/adapter/Test.java rename to src/main/java/io/github/dsheirer/sample/adapter/Test.java index 956e4c71..cec98e4a 100644 --- a/src/sample/adapter/Test.java +++ b/src/main/java/io/github/dsheirer/sample/adapter/Test.java @@ -1,10 +1,9 @@ -package sample.adapter; +package io.github.dsheirer.sample.adapter; +import io.github.dsheirer.source.tuner.hackrf.HackRFTunerController; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import source.tuner.hackrf.HackRFTunerController; - public class Test { private final static Logger mLog = diff --git a/src/sample/complex/Complex.java b/src/main/java/io/github/dsheirer/sample/complex/Complex.java similarity index 99% rename from src/sample/complex/Complex.java rename to src/main/java/io/github/dsheirer/sample/complex/Complex.java index 0a061ac1..e9a7fdc0 100644 --- a/src/sample/complex/Complex.java +++ b/src/main/java/io/github/dsheirer/sample/complex/Complex.java @@ -15,15 +15,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package sample.complex; - -import java.io.Serializable; +package io.github.dsheirer.sample.complex; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.Serializable; + /** - * Complex sample and related utility methods + * Complex sample and related utility methods */ public class Complex implements Serializable { diff --git a/src/sample/complex/ComplexBuffer.java b/src/main/java/io/github/dsheirer/sample/complex/ComplexBuffer.java similarity index 74% rename from src/sample/complex/ComplexBuffer.java rename to src/main/java/io/github/dsheirer/sample/complex/ComplexBuffer.java index 6cb6464e..336b61e8 100644 --- a/src/sample/complex/ComplexBuffer.java +++ b/src/main/java/io/github/dsheirer/sample/complex/ComplexBuffer.java @@ -1,9 +1,9 @@ -package sample.complex; +package io.github.dsheirer.sample.complex; + +import io.github.dsheirer.sample.Buffer; import java.util.Arrays; -import sample.Buffer; - public class ComplexBuffer extends Buffer { /** @@ -15,7 +15,7 @@ public class ComplexBuffer extends Buffer } /** - * Creates a deep copy of the buffer + * Creates a deep copy of the buffer */ public ComplexBuffer copyOf() { diff --git a/src/sample/complex/ComplexBufferToStreamConverter.java b/src/main/java/io/github/dsheirer/sample/complex/ComplexBufferToStreamConverter.java similarity index 87% rename from src/sample/complex/ComplexBufferToStreamConverter.java rename to src/main/java/io/github/dsheirer/sample/complex/ComplexBufferToStreamConverter.java index c8d1b464..9a13b4da 100644 --- a/src/sample/complex/ComplexBufferToStreamConverter.java +++ b/src/main/java/io/github/dsheirer/sample/complex/ComplexBufferToStreamConverter.java @@ -1,6 +1,6 @@ -package sample.complex; +package io.github.dsheirer.sample.complex; -import sample.Listener; +import io.github.dsheirer.sample.Listener; /** * Real sample buffer to stream converter diff --git a/src/sample/complex/ComplexSampleAssembler.java b/src/main/java/io/github/dsheirer/sample/complex/ComplexSampleAssembler.java similarity index 93% rename from src/sample/complex/ComplexSampleAssembler.java rename to src/main/java/io/github/dsheirer/sample/complex/ComplexSampleAssembler.java index a3b77b59..f617b9a8 100644 --- a/src/sample/complex/ComplexSampleAssembler.java +++ b/src/main/java/io/github/dsheirer/sample/complex/ComplexSampleAssembler.java @@ -15,14 +15,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package sample.complex; +package io.github.dsheirer.sample.complex; + +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.Provider; import java.util.ArrayList; import java.util.List; -import sample.Listener; -import sample.Provider; - public class ComplexSampleAssembler implements Listener, Provider> { diff --git a/src/sample/complex/ComplexSampleBroadcaster.java b/src/main/java/io/github/dsheirer/sample/complex/ComplexSampleBroadcaster.java similarity index 97% rename from src/sample/complex/ComplexSampleBroadcaster.java rename to src/main/java/io/github/dsheirer/sample/complex/ComplexSampleBroadcaster.java index a70186c2..08c8ba09 100644 --- a/src/sample/complex/ComplexSampleBroadcaster.java +++ b/src/main/java/io/github/dsheirer/sample/complex/ComplexSampleBroadcaster.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package sample.complex; +package io.github.dsheirer.sample.complex; import java.util.concurrent.CopyOnWriteArrayList; diff --git a/src/sample/complex/ComplexSampleListListener.java b/src/main/java/io/github/dsheirer/sample/complex/ComplexSampleListListener.java similarity index 95% rename from src/sample/complex/ComplexSampleListListener.java rename to src/main/java/io/github/dsheirer/sample/complex/ComplexSampleListListener.java index 564ff798..392f36ab 100644 --- a/src/sample/complex/ComplexSampleListListener.java +++ b/src/main/java/io/github/dsheirer/sample/complex/ComplexSampleListListener.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package sample.complex; +package io.github.dsheirer.sample.complex; import java.util.List; diff --git a/src/sample/complex/ComplexSampleListener.java b/src/main/java/io/github/dsheirer/sample/complex/ComplexSampleListener.java similarity index 66% rename from src/sample/complex/ComplexSampleListener.java rename to src/main/java/io/github/dsheirer/sample/complex/ComplexSampleListener.java index 1dca3f82..d2063f94 100644 --- a/src/sample/complex/ComplexSampleListener.java +++ b/src/main/java/io/github/dsheirer/sample/complex/ComplexSampleListener.java @@ -1,4 +1,4 @@ -package sample.complex; +package io.github.dsheirer.sample.complex; public interface ComplexSampleListener { diff --git a/src/sample/complex/ComplexSampleUtils.java b/src/main/java/io/github/dsheirer/sample/complex/ComplexSampleUtils.java similarity index 97% rename from src/sample/complex/ComplexSampleUtils.java rename to src/main/java/io/github/dsheirer/sample/complex/ComplexSampleUtils.java index a2bd93eb..2cada398 100644 --- a/src/sample/complex/ComplexSampleUtils.java +++ b/src/main/java/io/github/dsheirer/sample/complex/ComplexSampleUtils.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package sample.complex; +package io.github.dsheirer.sample.complex; public class ComplexSampleUtils diff --git a/src/sample/complex/ComplexToComplexBufferAssembler.java b/src/main/java/io/github/dsheirer/sample/complex/ComplexToComplexBufferAssembler.java similarity index 95% rename from src/sample/complex/ComplexToComplexBufferAssembler.java rename to src/main/java/io/github/dsheirer/sample/complex/ComplexToComplexBufferAssembler.java index 586d21c3..88cdb58b 100644 --- a/src/sample/complex/ComplexToComplexBufferAssembler.java +++ b/src/main/java/io/github/dsheirer/sample/complex/ComplexToComplexBufferAssembler.java @@ -15,10 +15,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package sample.complex; +package io.github.dsheirer.sample.complex; +import io.github.dsheirer.sample.Listener; import org.apache.commons.lang3.Validate; -import sample.Listener; /** * Assembles complex float samples into a ComplexBuffer containing an array of floats diff --git a/src/sample/complex/IComplexBufferListener.java b/src/main/java/io/github/dsheirer/sample/complex/IComplexBufferListener.java similarity index 55% rename from src/sample/complex/IComplexBufferListener.java rename to src/main/java/io/github/dsheirer/sample/complex/IComplexBufferListener.java index 5ec64dbb..7de93053 100644 --- a/src/sample/complex/IComplexBufferListener.java +++ b/src/main/java/io/github/dsheirer/sample/complex/IComplexBufferListener.java @@ -1,6 +1,6 @@ -package sample.complex; +package io.github.dsheirer.sample.complex; -import sample.Listener; +import io.github.dsheirer.sample.Listener; public interface IComplexBufferListener { diff --git a/src/sample/complex/RateCounter_CB.java b/src/main/java/io/github/dsheirer/sample/complex/RateCounter_CB.java similarity index 91% rename from src/sample/complex/RateCounter_CB.java rename to src/main/java/io/github/dsheirer/sample/complex/RateCounter_CB.java index abdc35e5..433b6653 100644 --- a/src/sample/complex/RateCounter_CB.java +++ b/src/main/java/io/github/dsheirer/sample/complex/RateCounter_CB.java @@ -1,10 +1,9 @@ -package sample.complex; +package io.github.dsheirer.sample.complex; +import io.github.dsheirer.sample.Listener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; - public class RateCounter_CB implements Listener { private final static Logger mLog = diff --git a/src/sample/complex/ThreadKiller.java b/src/main/java/io/github/dsheirer/sample/complex/ThreadKiller.java similarity index 96% rename from src/sample/complex/ThreadKiller.java rename to src/main/java/io/github/dsheirer/sample/complex/ThreadKiller.java index a6928865..feea8bd9 100644 --- a/src/sample/complex/ThreadKiller.java +++ b/src/main/java/io/github/dsheirer/sample/complex/ThreadKiller.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package sample.complex; +package io.github.dsheirer.sample.complex; /** * Poison Pill class to kill a processing thread. Where a thread accepts diff --git a/src/sample/decimator/ComplexDecimator.java b/src/main/java/io/github/dsheirer/sample/decimator/ComplexDecimator.java similarity index 89% rename from src/sample/decimator/ComplexDecimator.java rename to src/main/java/io/github/dsheirer/sample/decimator/ComplexDecimator.java index a5bdb55d..180ed7c7 100644 --- a/src/sample/decimator/ComplexDecimator.java +++ b/src/main/java/io/github/dsheirer/sample/decimator/ComplexDecimator.java @@ -1,6 +1,6 @@ -package sample.decimator; +package io.github.dsheirer.sample.decimator; -import sample.complex.ComplexSampleListener; +import io.github.dsheirer.sample.complex.ComplexSampleListener; public class ComplexDecimator implements ComplexSampleListener @@ -32,7 +32,7 @@ public class ComplexDecimator implements ComplexSampleListener } /** - * Receives samples allowing only 1 of every (rate) sample to go on + * Receives samples allowing only 1 of every (rate) sample to go on * to the registered listener */ @Override diff --git a/src/sample/decimator/Decimator.java b/src/main/java/io/github/dsheirer/sample/decimator/Decimator.java similarity index 95% rename from src/sample/decimator/Decimator.java rename to src/main/java/io/github/dsheirer/sample/decimator/Decimator.java index fe8c6661..2cddce54 100644 --- a/src/sample/decimator/Decimator.java +++ b/src/main/java/io/github/dsheirer/sample/decimator/Decimator.java @@ -15,9 +15,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package sample.decimator; +package io.github.dsheirer.sample.decimator; -import sample.Listener; +import io.github.dsheirer.sample.Listener; public class Decimator implements Listener @@ -31,7 +31,7 @@ public class Decimator implements Listener * DECIMATIONFACTOR. * * @param decimationFactor - number of samples to decimate. Provides one - * sample to registered listeners and discards the next decimationFactor - 1 + * sample to registered listeners and discards the next decimationFactor - 1 * samples. */ public Decimator( int decimationFactor ) @@ -40,7 +40,7 @@ public class Decimator implements Listener } /** - * Receives and broadcasts a sample and then discards the next + * Receives and broadcasts a sample and then discards the next * decimationFactor -1 samples */ public void receive( T t ) diff --git a/src/sample/decimator/RealDecimator.java b/src/main/java/io/github/dsheirer/sample/decimator/RealDecimator.java similarity index 89% rename from src/sample/decimator/RealDecimator.java rename to src/main/java/io/github/dsheirer/sample/decimator/RealDecimator.java index d8d34e31..c81ee3a5 100644 --- a/src/sample/decimator/RealDecimator.java +++ b/src/main/java/io/github/dsheirer/sample/decimator/RealDecimator.java @@ -1,6 +1,6 @@ -package sample.decimator; +package io.github.dsheirer.sample.decimator; -import sample.real.RealSampleListener; +import io.github.dsheirer.sample.real.RealSampleListener; public class RealDecimator implements RealSampleListener @@ -32,7 +32,7 @@ public class RealDecimator implements RealSampleListener } /** - * Receives samples allowing only 1 of every (rate) sample to go on + * Receives samples allowing only 1 of every (rate) sample to go on * to the registered listener */ @Override diff --git a/src/sample/real/IFilteredRealBufferListener.java b/src/main/java/io/github/dsheirer/sample/real/IFilteredRealBufferListener.java similarity index 57% rename from src/sample/real/IFilteredRealBufferListener.java rename to src/main/java/io/github/dsheirer/sample/real/IFilteredRealBufferListener.java index 06928fda..11465aea 100644 --- a/src/sample/real/IFilteredRealBufferListener.java +++ b/src/main/java/io/github/dsheirer/sample/real/IFilteredRealBufferListener.java @@ -1,6 +1,6 @@ -package sample.real; +package io.github.dsheirer.sample.real; -import sample.Listener; +import io.github.dsheirer.sample.Listener; public interface IFilteredRealBufferListener { diff --git a/src/sample/real/IFilteredRealBufferProvider.java b/src/main/java/io/github/dsheirer/sample/real/IFilteredRealBufferProvider.java similarity index 68% rename from src/sample/real/IFilteredRealBufferProvider.java rename to src/main/java/io/github/dsheirer/sample/real/IFilteredRealBufferProvider.java index e600d368..ead47fae 100644 --- a/src/sample/real/IFilteredRealBufferProvider.java +++ b/src/main/java/io/github/dsheirer/sample/real/IFilteredRealBufferProvider.java @@ -1,6 +1,6 @@ -package sample.real; +package io.github.dsheirer.sample.real; -import sample.Listener; +import io.github.dsheirer.sample.Listener; public interface IFilteredRealBufferProvider { diff --git a/src/sample/real/IOverflowListener.java b/src/main/java/io/github/dsheirer/sample/real/IOverflowListener.java similarity index 96% rename from src/sample/real/IOverflowListener.java rename to src/main/java/io/github/dsheirer/sample/real/IOverflowListener.java index 61202ea3..79930e64 100644 --- a/src/sample/real/IOverflowListener.java +++ b/src/main/java/io/github/dsheirer/sample/real/IOverflowListener.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package sample.real; +package io.github.dsheirer.sample.real; public interface IOverflowListener { diff --git a/src/sample/real/IUnFilteredRealBufferListener.java b/src/main/java/io/github/dsheirer/sample/real/IUnFilteredRealBufferListener.java similarity index 58% rename from src/sample/real/IUnFilteredRealBufferListener.java rename to src/main/java/io/github/dsheirer/sample/real/IUnFilteredRealBufferListener.java index bce0f168..52a1e35b 100644 --- a/src/sample/real/IUnFilteredRealBufferListener.java +++ b/src/main/java/io/github/dsheirer/sample/real/IUnFilteredRealBufferListener.java @@ -1,6 +1,6 @@ -package sample.real; +package io.github.dsheirer.sample.real; -import sample.Listener; +import io.github.dsheirer.sample.Listener; public interface IUnFilteredRealBufferListener { diff --git a/src/sample/real/IUnFilteredRealBufferProvider.java b/src/main/java/io/github/dsheirer/sample/real/IUnFilteredRealBufferProvider.java similarity index 68% rename from src/sample/real/IUnFilteredRealBufferProvider.java rename to src/main/java/io/github/dsheirer/sample/real/IUnFilteredRealBufferProvider.java index 764a5aeb..90100395 100644 --- a/src/sample/real/IUnFilteredRealBufferProvider.java +++ b/src/main/java/io/github/dsheirer/sample/real/IUnFilteredRealBufferProvider.java @@ -1,6 +1,6 @@ -package sample.real; +package io.github.dsheirer.sample.real; -import sample.Listener; +import io.github.dsheirer.sample.Listener; public interface IUnFilteredRealBufferProvider { diff --git a/src/sample/real/RateCounter_RB.java b/src/main/java/io/github/dsheirer/sample/real/RateCounter_RB.java similarity index 92% rename from src/sample/real/RateCounter_RB.java rename to src/main/java/io/github/dsheirer/sample/real/RateCounter_RB.java index de3ca3d7..287f80ed 100644 --- a/src/sample/real/RateCounter_RB.java +++ b/src/main/java/io/github/dsheirer/sample/real/RateCounter_RB.java @@ -1,10 +1,9 @@ -package sample.real; +package io.github.dsheirer.sample.real; +import io.github.dsheirer.sample.Listener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; - public class RateCounter_RB implements Listener { private final static Logger mLog = diff --git a/src/sample/real/RealBuffer.java b/src/main/java/io/github/dsheirer/sample/real/RealBuffer.java similarity index 74% rename from src/sample/real/RealBuffer.java rename to src/main/java/io/github/dsheirer/sample/real/RealBuffer.java index 75a86d07..5631a9bd 100644 --- a/src/sample/real/RealBuffer.java +++ b/src/main/java/io/github/dsheirer/sample/real/RealBuffer.java @@ -1,9 +1,9 @@ -package sample.real; +package io.github.dsheirer.sample.real; + +import io.github.dsheirer.sample.Buffer; import java.util.Arrays; -import sample.Buffer; - public class RealBuffer extends Buffer { /** @@ -15,7 +15,7 @@ public class RealBuffer extends Buffer } /** - * Creates a deep copy of the buffer + * Creates a deep copy of the buffer */ public RealBuffer copyOf() { diff --git a/src/sample/real/RealBufferToStreamConverter.java b/src/main/java/io/github/dsheirer/sample/real/RealBufferToStreamConverter.java similarity index 85% rename from src/sample/real/RealBufferToStreamConverter.java rename to src/main/java/io/github/dsheirer/sample/real/RealBufferToStreamConverter.java index bd25694d..a7495db8 100644 --- a/src/sample/real/RealBufferToStreamConverter.java +++ b/src/main/java/io/github/dsheirer/sample/real/RealBufferToStreamConverter.java @@ -1,6 +1,6 @@ -package sample.real; +package io.github.dsheirer.sample.real; -import sample.Listener; +import io.github.dsheirer.sample.Listener; /** * Real sample buffer to stream converter diff --git a/src/sample/real/RealSampleBroadcaster.java b/src/main/java/io/github/dsheirer/sample/real/RealSampleBroadcaster.java similarity index 97% rename from src/sample/real/RealSampleBroadcaster.java rename to src/main/java/io/github/dsheirer/sample/real/RealSampleBroadcaster.java index 5dbbb04e..b33ba053 100644 --- a/src/sample/real/RealSampleBroadcaster.java +++ b/src/main/java/io/github/dsheirer/sample/real/RealSampleBroadcaster.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package sample.real; +package io.github.dsheirer.sample.real; import java.util.concurrent.CopyOnWriteArrayList; diff --git a/src/sample/real/RealSampleListener.java b/src/main/java/io/github/dsheirer/sample/real/RealSampleListener.java similarity index 66% rename from src/sample/real/RealSampleListener.java rename to src/main/java/io/github/dsheirer/sample/real/RealSampleListener.java index de32950d..137d7d6a 100644 --- a/src/sample/real/RealSampleListener.java +++ b/src/main/java/io/github/dsheirer/sample/real/RealSampleListener.java @@ -1,4 +1,4 @@ -package sample.real; +package io.github.dsheirer.sample.real; public interface RealSampleListener { diff --git a/src/sample/real/RealSampleProvider.java b/src/main/java/io/github/dsheirer/sample/real/RealSampleProvider.java similarity index 80% rename from src/sample/real/RealSampleProvider.java rename to src/main/java/io/github/dsheirer/sample/real/RealSampleProvider.java index 3adcface..71cc4086 100644 --- a/src/sample/real/RealSampleProvider.java +++ b/src/main/java/io/github/dsheirer/sample/real/RealSampleProvider.java @@ -1,4 +1,4 @@ -package sample.real; +package io.github.dsheirer.sample.real; public interface RealSampleProvider { diff --git a/src/sample/real/RealToRealBufferAssembler.java b/src/main/java/io/github/dsheirer/sample/real/RealToRealBufferAssembler.java similarity index 95% rename from src/sample/real/RealToRealBufferAssembler.java rename to src/main/java/io/github/dsheirer/sample/real/RealToRealBufferAssembler.java index 3a476af7..08e07783 100644 --- a/src/sample/real/RealToRealBufferAssembler.java +++ b/src/main/java/io/github/dsheirer/sample/real/RealToRealBufferAssembler.java @@ -15,9 +15,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package sample.real; +package io.github.dsheirer.sample.real; -import sample.Listener; +import io.github.dsheirer.sample.Listener; /** * Assembles single float samples into a RealBuffer containing an array of floats diff --git a/src/main/java/io/github/dsheirer/settings/ColorSetting.java b/src/main/java/io/github/dsheirer/settings/ColorSetting.java new file mode 100644 index 00000000..9f4d2c10 --- /dev/null +++ b/src/main/java/io/github/dsheirer/settings/ColorSetting.java @@ -0,0 +1,197 @@ +/******************************************************************************* + * 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 + ******************************************************************************/ +package io.github.dsheirer.settings; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; + +import java.awt.*; + +public class ColorSetting extends Setting +{ + private static final int NO_TRANSLUCENCY = 255; + private static final int SPECTRUM_TRANSLUCENCY = 128; + private static final int CONFIG_TRANSLUCENCY = 60; + + private String mRGB; + private int mAlpha; + private ColorSettingName mColorSettingName = ColorSettingName.UNKNOWN; + + public ColorSetting() + { + setColor(mColorSettingName.getDefaultColor()); + } + + public ColorSetting(ColorSettingName name) + { + setColor(name.getDefaultColor()); + setColorSettingName(name); + } + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + @Override + public SettingType getType() + { + return SettingType.COLOR_SETTING; + } + + @JacksonXmlProperty(isAttribute = true, localName = "colorSettingName") + public ColorSettingName getColorSettingName() + { + return mColorSettingName; + } + + public void setColorSettingName(ColorSettingName name) + { + mColorSettingName = name; + } + + @JacksonXmlProperty(isAttribute = true, localName = "rgb") + public String getRgb() + { + return mRGB; + } + + public void setRgb(String value) + { + mRGB = value; + } + + @JacksonXmlProperty(isAttribute = true, localName = "alpha") + public int getAlpha() + { + return mAlpha; + } + + public void setAlpha(int value) + { + mAlpha = value; + } + + @JsonIgnore + public Color getColor() + { + Color temp = Color.decode(mRGB); + + return new Color(temp.getRed(), + temp.getGreen(), + temp.getBlue(), + mAlpha); + } + + public void setColor(Color color) + { + mRGB = Integer.toHexString(color.getRGB()); + mRGB = "#" + mRGB.substring(2, mRGB.length()); + mAlpha = color.getAlpha(); + } + + public static Color getTranslucent(Color color, int translucency) + { + return new Color(color.getRed(), + color.getGreen(), + color.getBlue(), + translucency); + } + + public enum ColorSettingName + { + CHANNEL_CONFIG(getTranslucent(Color.LIGHT_GRAY, CONFIG_TRANSLUCENCY), + "Channel", "Channel Color"), + CHANNEL_CONFIG_PROCESSING(getTranslucent(Color.GREEN, CONFIG_TRANSLUCENCY), + "Channel Processing", "Processing Channel Color"), + CHANNEL_CONFIG_SELECTED(getTranslucent(Color.BLUE, CONFIG_TRANSLUCENCY), + "Channel Selected", "Selected Channel Color"), + + CHANNEL_STATE_BACKGROUND(Color.BLACK, "Background", + "Channel State Background"), + CHANNEL_STATE_GRADIENT_TOP_CALL(Color.BLACK, + "Call Gradient Top", "Channel Call State Gradient Top"), + CHANNEL_STATE_GRADIENT_MIDDLE_CALL(Color.BLUE, + "Call Gradient Middle", "Channel Call State Gradient Middle"), + CHANNEL_STATE_GRADIENT_TOP_CONTROL(Color.BLACK, + "Control Gradient Top", "Channel Control State Gradient Top"), + CHANNEL_STATE_GRADIENT_MIDDLE_CONTROL(new Color(0xC64F00), + "Control Gradient Middle", "Channel Control State Gradient Middle"), + CHANNEL_STATE_GRADIENT_TOP_DATA(Color.BLACK, + "Data Gradient Top", "Channel Data State Gradient Top"), + CHANNEL_STATE_GRADIENT_MIDDLE_DATA(new Color(0xCC00CC), + "Data Gradient Middle", "Channel Data State Gradient Middle"), + CHANNEL_STATE_GRADIENT_TOP_FADE(Color.BLACK, + "Fade Gradient Top", "Channel Fade State Gradient Top"), + CHANNEL_STATE_GRADIENT_MIDDLE_FADE(Color.DARK_GRAY, + "Fade Gradient Middle", "Channel Fade State Gradient Middle"), + CHANNEL_STATE_GRADIENT_TOP_IDLE(Color.BLACK, + "Idle Gradient Top", "Channel Idle State Gradient Top"), + CHANNEL_STATE_GRADIENT_MIDDLE_IDLE(Color.DARK_GRAY, + "Idle Gradient Middle", "Channel Idle State Gradient Middle"), + CHANNEL_STATE_GRADIENT_TOP_NO_TUNER(Color.RED, + "No Tuner Gradient Top", "Channel No Tuner State Gradient Top"), + CHANNEL_STATE_GRADIENT_MIDDLE_NO_TUNER(new Color(0x990000), + "No Tuner Gradient Middle", "Channel No Tuner State Gradient Middle"), + CHANNEL_STATE_LABEL_DETAILS(Color.LIGHT_GRAY, + "Details", "Details Label Color"), + CHANNEL_STATE_LABEL_DECODER(Color.GREEN, + "Decoder", "Decoder Label Color"), + CHANNEL_STATE_LABEL_AUX_DECODER(Color.YELLOW, + "Aux Decoder", "Aux Decoder Label Color"), + CHANNEL_STATE_SELECTED_CHANNEL(Color.YELLOW, + "Selected Channel Indicator", "Selected Channel Indicator Color"), + + SPECTRUM_BACKGROUND(Color.BLACK, + "Background", "Spectrum Background Color"), + SPECTRUM_CURSOR(Color.ORANGE, + "Cursor", "Spectrum Cursor Color"), + SPECTRUM_GRADIENT_BOTTOM(getTranslucent(Color.GREEN, SPECTRUM_TRANSLUCENCY), + "Gradient Bottom", "Spectrum Gradient Bottom Color"), + SPECTRUM_GRADIENT_TOP(getTranslucent(Color.WHITE, SPECTRUM_TRANSLUCENCY), + "Gradient Top", "Spectrum Gradient Top Color"), + SPECTRUM_LINE(getTranslucent(Color.LIGHT_GRAY, SPECTRUM_TRANSLUCENCY), + "Line", "Spectrum Lines and Text Color"), + + UNKNOWN(Color.RED, "Unknown", "Unknown Setting Color"); + + private Color mDefaultColor; + private String mLabel; + private String mDialogTitle; + + private ColorSettingName(Color defaultColor, + String label, + String dialogTitle) + { + mDefaultColor = defaultColor; + mLabel = label; + mDialogTitle = dialogTitle; + } + + public Color getDefaultColor() + { + return mDefaultColor; + } + + public String getLabel() + { + return mLabel; + } + + public String getDialogTitle() + { + return mDialogTitle; + } + } +} diff --git a/src/settings/ColorSettingMenuItem.java b/src/main/java/io/github/dsheirer/settings/ColorSettingMenuItem.java similarity index 92% rename from src/settings/ColorSettingMenuItem.java rename to src/main/java/io/github/dsheirer/settings/ColorSettingMenuItem.java index d6045aae..4ca02622 100644 --- a/src/settings/ColorSettingMenuItem.java +++ b/src/main/java/io/github/dsheirer/settings/ColorSettingMenuItem.java @@ -15,18 +15,16 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package settings; +package io.github.dsheirer.settings; -import java.awt.Color; +import io.github.dsheirer.settings.ColorSetting.ColorSettingName; +import io.github.dsheirer.util.ColorIcon; + +import javax.swing.*; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import javax.swing.JColorChooser; -import javax.swing.JMenuItem; - -import settings.ColorSetting.ColorSettingName; -import util.ColorIcon; - /** * JMenuItem for selecting a color and automatically setting (saving) the * color selection in the settings manager diff --git a/src/settings/ColorSettingResetAllMenuItem.java b/src/main/java/io/github/dsheirer/settings/ColorSettingResetAllMenuItem.java similarity index 93% rename from src/settings/ColorSettingResetAllMenuItem.java rename to src/main/java/io/github/dsheirer/settings/ColorSettingResetAllMenuItem.java index 86595fd5..8aac9910 100644 --- a/src/settings/ColorSettingResetAllMenuItem.java +++ b/src/main/java/io/github/dsheirer/settings/ColorSettingResetAllMenuItem.java @@ -15,15 +15,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package settings; +package io.github.dsheirer.settings; +import io.github.dsheirer.settings.ColorSetting.ColorSettingName; + +import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import javax.swing.JMenuItem; - -import settings.ColorSetting.ColorSettingName; - /** * JMenuItem for selecting a color and automatically setting (saving) the * color selection in the settings manager diff --git a/src/settings/ColorSettingResetMenuItem.java b/src/main/java/io/github/dsheirer/settings/ColorSettingResetMenuItem.java similarity index 89% rename from src/settings/ColorSettingResetMenuItem.java rename to src/main/java/io/github/dsheirer/settings/ColorSettingResetMenuItem.java index e54a0a4a..03c0645c 100644 --- a/src/settings/ColorSettingResetMenuItem.java +++ b/src/main/java/io/github/dsheirer/settings/ColorSettingResetMenuItem.java @@ -15,15 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package settings; +package io.github.dsheirer.settings; +import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import javax.swing.JMenuItem; - -import settings.ColorSetting.ColorSettingName; - /** * JMenuItem for selecting a color and automatically setting (saving) the * color selection in the settings manager @@ -32,11 +29,11 @@ public class ColorSettingResetMenuItem extends JMenuItem { private static final long serialVersionUID = 1L; - private ColorSettingName mColorSettingName; + private ColorSetting.ColorSettingName mColorSettingName; private SettingsManager mSettingsManager; public ColorSettingResetMenuItem( SettingsManager settingsManager, - ColorSettingName colorSettingName ) + ColorSetting.ColorSettingName colorSettingName ) { super( "Reset - " + colorSettingName.getLabel() ); diff --git a/src/main/java/io/github/dsheirer/settings/FileSetting.java b/src/main/java/io/github/dsheirer/settings/FileSetting.java new file mode 100644 index 00000000..afa5f63e --- /dev/null +++ b/src/main/java/io/github/dsheirer/settings/FileSetting.java @@ -0,0 +1,62 @@ +/* + * ********************************************************************************************************************* + * 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 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 + * ********************************************************************************************************************* + */ +package io.github.dsheirer.settings; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; + +import java.io.File; + +public class FileSetting extends Setting +{ + private String mPath; + + public FileSetting() + { + super(); + } + + public FileSetting(String name, String path) + { + super(name); + setPath(path); + } + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + @Override + public SettingType getType() + { + return SettingType.FILE_SETTING; + } + + @JacksonXmlProperty(isAttribute = true, localName = "path") + public String getPath() + { + return mPath; + } + + public void setPath(String value) + { + mPath = value; + } + + @JsonIgnore + public File getFile() + { + return new File(mPath); + } +} diff --git a/src/main/java/io/github/dsheirer/settings/MapViewSetting.java b/src/main/java/io/github/dsheirer/settings/MapViewSetting.java new file mode 100644 index 00000000..483bf9c7 --- /dev/null +++ b/src/main/java/io/github/dsheirer/settings/MapViewSetting.java @@ -0,0 +1,104 @@ +/* + * ********************************************************************************************************************* + * 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 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 + * ********************************************************************************************************************* + */ + +package io.github.dsheirer.settings; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.jdesktop.swingx.mapviewer.GeoPosition; + +@JsonSubTypes.Type(value = MapViewSetting.class, name = "mapViewSetting") +public class MapViewSetting extends Setting +{ + private double mLatitude; + private double mLongitude; + private int mZoom; + + public MapViewSetting() + { + /* Empty constructor for JAXB */ + } + + public MapViewSetting(String name, double latitude, double longitude, int zoom) + { + super(name); + mLatitude = latitude; + mLongitude = longitude; + mZoom = zoom; + } + + public MapViewSetting(String name, GeoPosition position, int zoom) + { + super(name); + mLatitude = position.getLatitude(); + mLongitude = position.getLongitude(); + mZoom = zoom; + } + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + @Override + public SettingType getType() + { + return SettingType.MAP_VIEW_SETTING; + } + + @JacksonXmlProperty(isAttribute = true, localName = "latitude") + public double getLatitude() + { + return mLatitude; + } + + public void setLatitude(double latitude) + { + mLatitude = latitude; + } + + @JacksonXmlProperty(isAttribute = true, localName = "longitude") + public double getLongitude() + { + return mLongitude; + } + + public void setLongitude(double longitude) + { + mLongitude = longitude; + } + + @JacksonXmlProperty(isAttribute = true, localName = "zoom") + public int getZoom() + { + return mZoom; + } + + public void setZoom(int zoom) + { + mZoom = zoom; + } + + @JsonIgnore + public GeoPosition getGeoPosition() + { + return new GeoPosition(mLatitude, mLongitude); + } + + public void setGeoPosition(GeoPosition position) + { + mLatitude = position.getLatitude(); + mLongitude = position.getLongitude(); + } +} diff --git a/src/main/java/io/github/dsheirer/settings/Setting.java b/src/main/java/io/github/dsheirer/settings/Setting.java new file mode 100644 index 00000000..0cb497d1 --- /dev/null +++ b/src/main/java/io/github/dsheirer/settings/Setting.java @@ -0,0 +1,62 @@ +/* + * ********************************************************************************************************************* + * 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 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 + * ********************************************************************************************************************* + */ +package io.github.dsheirer.settings; + +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.map.DefaultIcon; +import io.github.dsheirer.map.MapIcon; + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include= JsonTypeInfo.As.PROPERTY, property="type") +@JsonSubTypes({ + @JsonSubTypes.Type(value=ColorSetting.class, name="colorSetting"), + @JsonSubTypes.Type(value=DefaultIcon.class, name="defaultIcon"), + @JsonSubTypes.Type(value=FileSetting.class, name="fileSetting"), + @JsonSubTypes.Type(value=MapIcon.class, name="mapIcon"), + @JsonSubTypes.Type(value=MapViewSetting.class, name="mapViewSetting"), +}) +@JacksonXmlRootElement( localName = "setting" ) +public abstract class Setting +{ + protected String mName; + + public Setting() + { + } + + public Setting(String name) + { + mName = name; + } + + @JacksonXmlProperty(isAttribute = true, localName = "name") + public String getName() + { + return mName; + } + + public void setName(String name) + { + mName = name; + } + + @JsonIgnore + public abstract SettingType getType(); +} diff --git a/src/settings/SettingChangeListener.java b/src/main/java/io/github/dsheirer/settings/SettingChangeListener.java similarity index 96% rename from src/settings/SettingChangeListener.java rename to src/main/java/io/github/dsheirer/settings/SettingChangeListener.java index b5550bb2..87eebb30 100644 --- a/src/settings/SettingChangeListener.java +++ b/src/main/java/io/github/dsheirer/settings/SettingChangeListener.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package settings; +package io.github.dsheirer.settings; public interface SettingChangeListener { diff --git a/src/main/java/io/github/dsheirer/settings/SettingType.java b/src/main/java/io/github/dsheirer/settings/SettingType.java new file mode 100644 index 00000000..3cfa0d08 --- /dev/null +++ b/src/main/java/io/github/dsheirer/settings/SettingType.java @@ -0,0 +1,28 @@ +/* + * ********************************************************************************************************************* + * 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 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 + * ********************************************************************************************************************* + */ + +package io.github.dsheirer.settings; + +public enum SettingType +{ + COLOR_SETTING, + DEFAULT_ICON, + FILE_SETTING, + MAP_ICON, + MAP_VIEW_SETTING, + UNKNOWN; +} diff --git a/src/main/java/io/github/dsheirer/settings/Settings.java b/src/main/java/io/github/dsheirer/settings/Settings.java new file mode 100644 index 00000000..8da930da --- /dev/null +++ b/src/main/java/io/github/dsheirer/settings/Settings.java @@ -0,0 +1,210 @@ +/* + * ********************************************************************************************************************* + * 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 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 + * ********************************************************************************************************************* + */ +package io.github.dsheirer.settings; + +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.map.DefaultIcon; +import io.github.dsheirer.map.MapIcon; +import io.github.dsheirer.settings.ColorSetting.ColorSettingName; +import io.github.dsheirer.source.recording.RecordingConfiguration; +import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; + +import java.util.ArrayList; +import java.util.List; + +@JacksonXmlRootElement(localName = "SDRTrunk_settings") +public class Settings +{ + private List mSettings = new ArrayList(); + + private List mTunerConfiguration = new ArrayList(); + + private List mRecordingConfigurations = new ArrayList(); + + public Settings() + { + } + + @JacksonXmlProperty(isAttribute = false, localName = "recording_configuration") + public List getRecordingConfigurations() + { + return mRecordingConfigurations; + } + + public void setRecordingConfigurations(ArrayList configs) + { + mRecordingConfigurations = configs; + } + + public void addRecordingConfiguration(RecordingConfiguration config) + { + mRecordingConfigurations.add(config); + } + + public void removeRecordingConfiguration(RecordingConfiguration config) + { + mRecordingConfigurations.remove(config); + } + + @JacksonXmlProperty(isAttribute = false, localName = "tuner_configuration") + public List getTunerConfigurations() + { + return mTunerConfiguration; + } + + public void setTunerConfigurations(List configs) + { + mTunerConfiguration = configs; + } + + @JacksonXmlProperty(isAttribute = false, localName = "setting") + public List getSettings() + { + return mSettings; + } + + public void setSettings(ArrayList settings) + { + mSettings = settings; + } + + public Setting getSetting(String name) + { + for(Setting setting : mSettings) + { + if(setting.getName().contentEquals(name)) + { + return setting; + } + } + + return null; + } + + public void addSetting(Setting setting) + { + mSettings.add(setting); + } + + public void removeSetting(Setting setting) + { + mSettings.remove(setting); + } + + @JsonIgnore + public DefaultIcon getDefaultIcon() + { + for(Setting setting : mSettings) + { + if(setting instanceof DefaultIcon) + { + return (DefaultIcon)setting; + } + } + + return null; + } + + public ColorSetting getColorSetting(ColorSettingName name) + { + for(Setting setting : mSettings) + { + if(setting instanceof ColorSetting && + ((ColorSetting)setting).getColorSettingName() == name) + { + return (ColorSetting)setting; + } + } + + return null; + } + + @JsonIgnore + public List getColorSettings() + { + ArrayList colors = new ArrayList(); + + for(Setting setting : mSettings) + { + if(setting instanceof ColorSetting) + { + colors.add((ColorSetting)setting); + } + } + + return colors; + } + + public FileSetting getFileSetting(String name) + { + for(Setting setting : mSettings) + { + if(setting instanceof FileSetting && + setting.getName().contentEquals(name)) + { + return (FileSetting)setting; + } + } + + return null; + } + + public MapIcon getMapIcon(String name) + { + for(Setting setting : mSettings) + { + if(setting instanceof MapIcon && + setting.getName().contentEquals(name)) + { + return (MapIcon)setting; + } + } + + return null; + } + + public ArrayList getMapIcons() + { + ArrayList icons = new ArrayList(); + + for(Setting setting : mSettings) + { + if(setting instanceof MapIcon) + { + icons.add((MapIcon)setting); + } + } + + return icons; + } + + public MapViewSetting getMapViewSetting(String name) + { + for(Setting setting : mSettings) + { + if(setting instanceof MapViewSetting && + setting.getName().contentEquals(name)) + { + return (MapViewSetting)setting; + } + } + + return null; + } +} diff --git a/src/settings/SettingsManager.java b/src/main/java/io/github/dsheirer/settings/SettingsManager.java similarity index 67% rename from src/settings/SettingsManager.java rename to src/main/java/io/github/dsheirer/settings/SettingsManager.java index 87d65bce..00ccf70e 100644 --- a/src/settings/SettingsManager.java +++ b/src/main/java/io/github/dsheirer/settings/SettingsManager.java @@ -1,41 +1,36 @@ -/******************************************************************************* - * SDR Trunk - * Copyright (C) 2014-2016 Dennis Sheirer +/* + * ********************************************************************************************************************* + * 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 - ******************************************************************************/ -package settings; + * You should have received a copy of the GNU General Public License along with this program. + * If not, see + * ********************************************************************************************************************* + */ +package io.github.dsheirer.settings; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.dataformat.xml.JacksonXmlModule; +import com.fasterxml.jackson.dataformat.xml.XmlMapper; +import io.github.dsheirer.properties.SystemProperties; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.source.recording.RecordingConfiguration; +import io.github.dsheirer.source.tuner.configuration.TunerConfigurationEvent; +import io.github.dsheirer.source.tuner.configuration.TunerConfigurationModel; +import io.github.dsheirer.util.ThreadPool; import org.jdesktop.swingx.mapviewer.GeoPosition; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import properties.SystemProperties; -import sample.Listener; -import settings.ColorSetting.ColorSettingName; -import source.recording.RecordingConfiguration; -import source.tuner.configuration.TunerConfigurationEvent; -import source.tuner.configuration.TunerConfigurationModel; -import util.ThreadPool; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Marshaller; -import javax.xml.bind.Unmarshaller; import java.awt.*; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -118,7 +113,7 @@ public class SettingsManager implements Listener * Returns the current setting, or if the setting doesn't exist * returns a newly created setting with the specified parameters */ - public ColorSetting getColorSetting(ColorSettingName name) + public ColorSetting getColorSetting(ColorSetting.ColorSettingName name) { ColorSetting setting = mSettings.getColorSetting(name); @@ -137,7 +132,7 @@ public class SettingsManager implements Listener * Fetches the current setting and applies the parameter(s) to it. Creates * the setting if it does not exist */ - public void setColorSetting(ColorSettingName name, Color color) + public void setColorSetting(ColorSetting.ColorSettingName name, Color color) { ColorSetting setting = getColorSetting(name); @@ -148,7 +143,7 @@ public class SettingsManager implements Listener scheduleSettingsSave(); } - public void resetColorSetting(ColorSettingName name) + public void resetColorSetting(ColorSetting.ColorSettingName name) { setColorSetting(name, name.getDefaultColor()); } @@ -257,11 +252,9 @@ public class SettingsManager implements Listener { saveTunerConfigurationModel(); - JAXBContext context = null; - SystemProperties props = SystemProperties.getInstance(); - Path settingsPath = props.getApplicationFolder("settings"); + Path settingsFolder = props.getApplicationFolder("settings"); String settingsDefault = props.get("settings.defaultFilename", "settings.xml"); @@ -269,63 +262,24 @@ public class SettingsManager implements Listener String settingsCurrent = props.get("settings.currentFilename", settingsDefault); - Path filePath = settingsPath.resolve(settingsCurrent); + Path settingsPath = settingsFolder.resolve(settingsCurrent); - File outputFile = new File(filePath.toString()); - - try + try(OutputStream out = Files.newOutputStream(settingsPath)) { - if(!outputFile.exists()) - { - outputFile.createNewFile(); - } + JacksonXmlModule xmlModule = new JacksonXmlModule(); + xmlModule.setDefaultUseWrapper(false); + ObjectMapper objectMapper = new XmlMapper(xmlModule); + objectMapper.enable(SerializationFeature.INDENT_OUTPUT); + objectMapper.writeValue(out, mSettings); + out.flush(); + } + catch(IOException ioe) + { + mLog.error("IO error while writing the settings to a file [" + settingsPath + "]", ioe); } catch(Exception e) { - mLog.error("SettingsManager - couldn't create file to save " - + "settings [" + filePath.toString() + "]", e); - } - - OutputStream out = null; - - try - { - out = new FileOutputStream(outputFile); - - try - { - context = JAXBContext.newInstance(Settings.class); - - Marshaller m = context.createMarshaller(); - - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); - - m.marshal(mSettings, out); - } - catch(JAXBException e) - { - mLog.error("SettingsManager - jaxb exception while saving " + - "settings", e); - } - } - catch(Exception e) - { - mLog.error("SettingsManager - coulcn't open outputstream to " + - "save settings [" + filePath.toString() + "]"); - } - finally - { - if(out != null) - { - try - { - out.close(); - } - catch(IOException e) - { - e.printStackTrace(); - } - } + mLog.error("Error while saving settings file [" + settingsPath + "]", e); } } @@ -341,47 +295,17 @@ public class SettingsManager implements Listener { mLog.info("SettingsManager - loading settings file [" + settingsPath.toString() + "]"); - JAXBContext context = null; + JacksonXmlModule xmlModule = new JacksonXmlModule(); + xmlModule.setDefaultUseWrapper(false); + ObjectMapper objectMapper = new XmlMapper(xmlModule); - InputStream in = null; - - try + try(InputStream in = Files.newInputStream(settingsPath)) { - in = new FileInputStream(settingsPath.toString()); - - try - { - context = JAXBContext.newInstance(Settings.class); - - Unmarshaller m = context.createUnmarshaller(); - - mSettings = (Settings) m.unmarshal(in); - } - catch(JAXBException e) - { - mLog.error("SettingsManager - jaxb exception while loading " + - "settings", e); - } + mSettings = objectMapper.readValue(in, Settings.class); } - catch(Exception e) + catch(IOException ioe) { - mLog.error("SettingsManager - coulcn't open inputstream to " + - "load settings [" + settingsPath.toString() + "]", e); - } - finally - { - if(in != null) - { - try - { - in.close(); - } - catch(IOException e) - { - mLog.error("SettingsManager - exception while closing " + - "the settings file inputstream reader", e); - } - } + mLog.error("IO error while reading settings file", ioe); } } else diff --git a/src/source/BufferReceiver.java b/src/main/java/io/github/dsheirer/source/BufferReceiver.java similarity index 96% rename from src/source/BufferReceiver.java rename to src/main/java/io/github/dsheirer/source/BufferReceiver.java index c01d7f54..cb7e6b3b 100644 --- a/src/source/BufferReceiver.java +++ b/src/main/java/io/github/dsheirer/source/BufferReceiver.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source; +package io.github.dsheirer.source; public interface BufferReceiver { diff --git a/src/main/java/io/github/dsheirer/source/ComplexSource.java b/src/main/java/io/github/dsheirer/source/ComplexSource.java new file mode 100644 index 00000000..30add060 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/ComplexSource.java @@ -0,0 +1,13 @@ +package io.github.dsheirer.source; + +import io.github.dsheirer.sample.Provider; +import io.github.dsheirer.sample.SampleType; +import io.github.dsheirer.sample.complex.ComplexBuffer; + +public abstract class ComplexSource extends Source implements Provider +{ + public ComplexSource() + { + super( SampleType.COMPLEX ); + } +} diff --git a/src/source/IControllableFileSource.java b/src/main/java/io/github/dsheirer/source/IControllableFileSource.java similarity index 95% rename from src/source/IControllableFileSource.java rename to src/main/java/io/github/dsheirer/source/IControllableFileSource.java index ffac7725..13270141 100644 --- a/src/source/IControllableFileSource.java +++ b/src/main/java/io/github/dsheirer/source/IControllableFileSource.java @@ -1,9 +1,8 @@ -package source; - -import java.io.File; -import java.io.IOException; +package io.github.dsheirer.source; import javax.sound.sampled.UnsupportedAudioFileException; +import java.io.File; +import java.io.IOException; /** * Defines a controllable source that can be manually controlled for stepping diff --git a/src/source/IFrameLocationListener.java b/src/main/java/io/github/dsheirer/source/IFrameLocationListener.java similarity index 79% rename from src/source/IFrameLocationListener.java rename to src/main/java/io/github/dsheirer/source/IFrameLocationListener.java index 485d5ed7..8bcee46e 100644 --- a/src/source/IFrameLocationListener.java +++ b/src/main/java/io/github/dsheirer/source/IFrameLocationListener.java @@ -1,4 +1,4 @@ -package source; +package io.github.dsheirer.source; public interface IFrameLocationListener { diff --git a/src/source/InvalidFrequencyException.java b/src/main/java/io/github/dsheirer/source/InvalidFrequencyException.java similarity index 98% rename from src/source/InvalidFrequencyException.java rename to src/main/java/io/github/dsheirer/source/InvalidFrequencyException.java index 77e1bee7..54bd8666 100644 --- a/src/source/InvalidFrequencyException.java +++ b/src/main/java/io/github/dsheirer/source/InvalidFrequencyException.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package source; +package io.github.dsheirer.source; public class InvalidFrequencyException extends SourceException { diff --git a/src/main/java/io/github/dsheirer/source/RealSource.java b/src/main/java/io/github/dsheirer/source/RealSource.java new file mode 100644 index 00000000..3f73e7c1 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/RealSource.java @@ -0,0 +1,14 @@ +package io.github.dsheirer.source; + +import io.github.dsheirer.sample.Provider; +import io.github.dsheirer.sample.SampleType; +import io.github.dsheirer.sample.real.RealBuffer; + + +public abstract class RealSource extends Source implements Provider +{ + public RealSource() + { + super( SampleType.REAL ); + } +} diff --git a/src/source/Source.java b/src/main/java/io/github/dsheirer/source/Source.java similarity index 84% rename from src/source/Source.java rename to src/main/java/io/github/dsheirer/source/Source.java index 9b253fa5..23916db2 100644 --- a/src/source/Source.java +++ b/src/main/java/io/github/dsheirer/source/Source.java @@ -15,14 +15,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source; +package io.github.dsheirer.source; -import channel.heartbeat.IHeartbeatProvider; -import module.Module; -import sample.SampleType; -import sample.real.IOverflowListener; -import source.tuner.frequency.IFrequencyChangeListener; -import source.tuner.frequency.IFrequencyChangeProvider; +import io.github.dsheirer.channel.heartbeat.IHeartbeatProvider; +import io.github.dsheirer.module.Module; +import io.github.dsheirer.sample.SampleType; +import io.github.dsheirer.sample.real.IOverflowListener; +import io.github.dsheirer.source.tuner.frequency.IFrequencyChangeListener; +import io.github.dsheirer.source.tuner.frequency.IFrequencyChangeProvider; /** * Abstract class to define the minimum functionality of a sample data provider. diff --git a/src/source/SourceConfigurationEditor.java b/src/main/java/io/github/dsheirer/source/SourceConfigurationEditor.java similarity index 90% rename from src/source/SourceConfigurationEditor.java rename to src/main/java/io/github/dsheirer/source/SourceConfigurationEditor.java index 2c16c299..4f404e2b 100644 --- a/src/source/SourceConfigurationEditor.java +++ b/src/main/java/io/github/dsheirer/source/SourceConfigurationEditor.java @@ -15,23 +15,20 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source; +package io.github.dsheirer.source; -import gui.editor.Editor; -import gui.editor.EmptyEditor; +import io.github.dsheirer.controller.channel.Channel; +import io.github.dsheirer.gui.editor.Editor; +import io.github.dsheirer.gui.editor.EmptyEditor; +import io.github.dsheirer.source.config.SourceConfiguration; +import io.github.dsheirer.source.mixer.MixerSourceEditor; +import io.github.dsheirer.source.tuner.TunerSourceEditor; +import net.miginfocom.swing.MigLayout; +import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import javax.swing.DefaultComboBoxModel; -import javax.swing.JComboBox; - -import net.miginfocom.swing.MigLayout; -import source.config.SourceConfiguration; -import source.mixer.MixerSourceEditor; -import source.tuner.TunerSourceEditor; -import controller.channel.Channel; - public class SourceConfigurationEditor extends Editor { private static final long serialVersionUID = 1L; diff --git a/src/source/SourceException.java b/src/main/java/io/github/dsheirer/source/SourceException.java similarity index 97% rename from src/source/SourceException.java rename to src/main/java/io/github/dsheirer/source/SourceException.java index 2dc02443..79968b12 100644 --- a/src/source/SourceException.java +++ b/src/main/java/io/github/dsheirer/source/SourceException.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source; +package io.github.dsheirer.source; public class SourceException extends Exception { diff --git a/src/source/SourceManager.java b/src/main/java/io/github/dsheirer/source/SourceManager.java similarity index 85% rename from src/source/SourceManager.java rename to src/main/java/io/github/dsheirer/source/SourceManager.java index 182bbeb2..1a798b69 100644 --- a/src/source/SourceManager.java +++ b/src/main/java/io/github/dsheirer/source/SourceManager.java @@ -16,15 +16,15 @@ * along with this program. If not, see * ******************************************************************************/ -package source; +package io.github.dsheirer.source; -import settings.SettingsManager; -import source.config.SourceConfigTuner; -import source.config.SourceConfiguration; -import source.mixer.MixerManager; -import source.recording.RecordingSourceManager; -import source.tuner.TunerManager; -import source.tuner.TunerModel; +import io.github.dsheirer.settings.SettingsManager; +import io.github.dsheirer.source.config.SourceConfigTuner; +import io.github.dsheirer.source.config.SourceConfiguration; +import io.github.dsheirer.source.mixer.MixerManager; +import io.github.dsheirer.source.recording.RecordingSourceManager; +import io.github.dsheirer.source.tuner.TunerManager; +import io.github.dsheirer.source.tuner.TunerModel; public class SourceManager { diff --git a/src/source/SourceType.java b/src/main/java/io/github/dsheirer/source/SourceType.java similarity index 97% rename from src/source/SourceType.java rename to src/main/java/io/github/dsheirer/source/SourceType.java index 421bdd91..1145bcf7 100644 --- a/src/source/SourceType.java +++ b/src/main/java/io/github/dsheirer/source/SourceType.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source; +package io.github.dsheirer.source; public enum SourceType diff --git a/src/source/config/SourceConfigFactory.java b/src/main/java/io/github/dsheirer/source/config/SourceConfigFactory.java similarity index 96% rename from src/source/config/SourceConfigFactory.java rename to src/main/java/io/github/dsheirer/source/config/SourceConfigFactory.java index 788518a1..851f3bff 100644 --- a/src/source/config/SourceConfigFactory.java +++ b/src/main/java/io/github/dsheirer/source/config/SourceConfigFactory.java @@ -15,9 +15,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.config; +package io.github.dsheirer.source.config; -import source.SourceType; +import io.github.dsheirer.source.SourceType; public class SourceConfigFactory { diff --git a/src/main/java/io/github/dsheirer/source/config/SourceConfigMixer.java b/src/main/java/io/github/dsheirer/source/config/SourceConfigMixer.java new file mode 100644 index 00000000..b0762e01 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/config/SourceConfigMixer.java @@ -0,0 +1,78 @@ +/******************************************************************************* + * 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 + ******************************************************************************/ +package io.github.dsheirer.source.config; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.github.dsheirer.source.SourceType; +import io.github.dsheirer.source.mixer.MixerChannel; + +@JsonSubTypes.Type(value = SourceConfigMixer.class, name = "sourceConfigMixer") +public class SourceConfigMixer extends SourceConfiguration +{ + protected String mMixer; + protected MixerChannel mChannel = MixerChannel.LEFT; //default + + public SourceConfigMixer() + { + super(SourceType.MIXER); + } + + @JsonIgnore + @Override + public String getDescription() + { + return getName(); + } + + @JsonIgnore + public String getName() + { + StringBuilder sb = new StringBuilder(); + + sb.append("Mixer: "); + sb.append(mMixer); + sb.append("-"); + sb.append(mChannel.toString()); + + return sb.toString(); + } + + @JacksonXmlProperty(isAttribute = true, localName = "mixer") + public String getMixer() + { + return mMixer; + } + + public void setMixer(String mixer) + { + mMixer = mixer; + } + + @JacksonXmlProperty(isAttribute = true, localName = "channel") + public MixerChannel getChannel() + { + return mChannel; + } + + public void setChannel(MixerChannel channel) + { + mChannel = channel; + } +} diff --git a/src/source/config/SourceConfigNone.java b/src/main/java/io/github/dsheirer/source/config/SourceConfigNone.java similarity index 71% rename from src/source/config/SourceConfigNone.java rename to src/main/java/io/github/dsheirer/source/config/SourceConfigNone.java index 57c8f6d0..8f1ccb33 100644 --- a/src/source/config/SourceConfigNone.java +++ b/src/main/java/io/github/dsheirer/source/config/SourceConfigNone.java @@ -1,34 +1,38 @@ /******************************************************************************* * 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 ******************************************************************************/ -package source.config; +package io.github.dsheirer.source.config; -import source.SourceType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import io.github.dsheirer.source.SourceType; +@JsonSubTypes.Type(value = SourceConfigNone.class, name = "sourceConfigNone") public class SourceConfigNone extends SourceConfiguration { - public SourceConfigNone() + public SourceConfigNone() { - super( SourceType.NONE ); + super(SourceType.NONE); } - @Override + @JsonIgnore + @Override public String getDescription() { - return "No Source"; + return "No Source"; } } diff --git a/src/source/config/SourceConfigRecording.java b/src/main/java/io/github/dsheirer/source/config/SourceConfigRecording.java similarity index 80% rename from src/source/config/SourceConfigRecording.java rename to src/main/java/io/github/dsheirer/source/config/SourceConfigRecording.java index 801fb211..aa8717b5 100644 --- a/src/source/config/SourceConfigRecording.java +++ b/src/main/java/io/github/dsheirer/source/config/SourceConfigRecording.java @@ -15,13 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.config; +package io.github.dsheirer.source.config; -import javax.xml.bind.annotation.XmlAttribute; - -import source.SourceType; -import source.tuner.TunerChannel; -import source.tuner.TunerChannel.Type; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.github.dsheirer.source.SourceType; +import io.github.dsheirer.source.tuner.TunerChannel; +import io.github.dsheirer.source.tuner.TunerChannel.Type; public class SourceConfigRecording extends SourceConfiguration { @@ -32,8 +31,8 @@ public class SourceConfigRecording extends SourceConfiguration { super( SourceType.RECORDING ); } - - @XmlAttribute( name = "recording_alias" ) + + @JacksonXmlProperty(isAttribute=true,localName= "recording_alias" ) public String getRecordingAlias() { return mRecordingAlias; @@ -44,7 +43,7 @@ public class SourceConfigRecording extends SourceConfiguration mRecordingAlias = alias; } - @XmlAttribute( name = "frequency" ) + @JacksonXmlProperty(isAttribute=true,localName= "frequency" ) public long getFrequency() { return mFrequency; diff --git a/src/main/java/io/github/dsheirer/source/config/SourceConfigTuner.java b/src/main/java/io/github/dsheirer/source/config/SourceConfigTuner.java new file mode 100644 index 00000000..a542e8c6 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/config/SourceConfigTuner.java @@ -0,0 +1,73 @@ +/******************************************************************************* + * 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 + ******************************************************************************/ +package io.github.dsheirer.source.config; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.github.dsheirer.source.SourceType; +import io.github.dsheirer.source.tuner.TunerChannel; +import io.github.dsheirer.source.tuner.TunerChannel.Type; + +import java.text.DecimalFormat; + +@JsonSubTypes.Type(value = SourceConfigTuner.class, name = "sourceConfigTuner") +public class SourceConfigTuner extends SourceConfiguration +{ + private static DecimalFormat sFORMAT = new DecimalFormat("0.00000"); + + private long mFrequency = 0; + private int mBandwidth = 12500; + + public SourceConfigTuner() + { + super(SourceType.TUNER); + } + + public SourceConfigTuner(TunerChannel tunerChannel) + { + this(); + + mFrequency = tunerChannel.getFrequency(); + mBandwidth = tunerChannel.getBandwidth(); + } + + @JacksonXmlProperty(isAttribute = true, localName = "frequency") + public long getFrequency() + { + return mFrequency; + } + + public void setFrequency(long frequency) + { + mFrequency = frequency; + } + + @JsonIgnore + @Override + public String getDescription() + { + return sFORMAT.format((double)mFrequency / 1000000.0d) + " MHz"; + } + + @JsonIgnore + public TunerChannel getTunerChannel() + { + return new TunerChannel(Type.LOCKED, mFrequency, mBandwidth); + } +} diff --git a/src/main/java/io/github/dsheirer/source/config/SourceConfiguration.java b/src/main/java/io/github/dsheirer/source/config/SourceConfiguration.java new file mode 100644 index 00000000..7d4adb66 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/config/SourceConfiguration.java @@ -0,0 +1,74 @@ +/******************************************************************************* + * 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 + ******************************************************************************/ +package io.github.dsheirer.source.config; + +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.source.SourceType; + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = SourceConfigMixer.class, name = "sourceConfigMixer"), + @JsonSubTypes.Type(value = SourceConfigNone.class, name = "sourceConfigNone"), + @JsonSubTypes.Type(value = SourceConfigRecording.class, name = "sourceConfigRecording"), + @JsonSubTypes.Type(value = SourceConfigTuner.class, name = "sourceConfigTuner"), +}) +@JacksonXmlRootElement(localName = "source_configuration") +public class SourceConfiguration extends Configuration +{ + protected SourceType mSourceType; + + public SourceConfiguration() + { + this(SourceType.NONE); + } + + public SourceConfiguration(SourceType source) + { + mSourceType = source; + } + + @JacksonXmlProperty(isAttribute = true, localName = "source_type") + public SourceType getSourceType() + { + return mSourceType; + } + + public void setSourceType(SourceType source) + { + mSourceType = source; + } + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + private String getType() + { + return null; + } + + private void setType(String type) + { + } + + public String getDescription() + { + return "No Source"; + } +} diff --git a/src/source/mixer/ComplexMixer.java b/src/main/java/io/github/dsheirer/source/mixer/ComplexMixer.java similarity index 96% rename from src/source/mixer/ComplexMixer.java rename to src/main/java/io/github/dsheirer/source/mixer/ComplexMixer.java index 009666ef..735afe52 100644 --- a/src/source/mixer/ComplexMixer.java +++ b/src/main/java/io/github/dsheirer/source/mixer/ComplexMixer.java @@ -15,22 +15,20 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.mixer; +package io.github.dsheirer.source.mixer; -import java.util.concurrent.atomic.AtomicBoolean; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.adapter.ISampleAdapter; +import io.github.dsheirer.sample.complex.ComplexBuffer; +import io.github.dsheirer.source.SourceException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.TargetDataLine; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import sample.Listener; -import sample.adapter.ISampleAdapter; -import sample.complex.ComplexBuffer; -import source.SourceException; +import java.util.concurrent.atomic.AtomicBoolean; public class ComplexMixer { @@ -50,9 +48,9 @@ public class ComplexMixer /** * Complex Mixer - constructs a reader on the mixer/sound card target - * data line using the specified audio format (sample size, sample rate ) + * data line using the specified audio format (sample size, sample rate ) * and broadcasts complex (I/Q) sample buffers to all registered listeners. - * Reads sample buffers sized to 10% of the sample rate specified in audio + * Reads sample buffers sized to 10% of the sample rate specified in audio * format. * * @param targetDataLine - mixer or sound card to be used @@ -62,7 +60,7 @@ public class ComplexMixer * @param name - token name to use for this mixer * * @param sampleAdapter - adapter to convert byte array data read from the - * mixer into ComplexBuffer. The adapter can optionally invert the channel + * mixer into ComplexBuffer. The adapter can optionally invert the channel * data if the left/right stereo channels are inverted. */ public ComplexMixer( TargetDataLine targetDataLine, diff --git a/src/source/mixer/MixerChannel.java b/src/main/java/io/github/dsheirer/source/mixer/MixerChannel.java similarity index 97% rename from src/source/mixer/MixerChannel.java rename to src/main/java/io/github/dsheirer/source/mixer/MixerChannel.java index 956ec41d..3148aabf 100644 --- a/src/source/mixer/MixerChannel.java +++ b/src/main/java/io/github/dsheirer/source/mixer/MixerChannel.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.mixer; +package io.github.dsheirer.source.mixer; import java.util.EnumSet; diff --git a/src/source/mixer/MixerChannelConfiguration.java b/src/main/java/io/github/dsheirer/source/mixer/MixerChannelConfiguration.java similarity index 97% rename from src/source/mixer/MixerChannelConfiguration.java rename to src/main/java/io/github/dsheirer/source/mixer/MixerChannelConfiguration.java index b8520bcc..c54c5b81 100644 --- a/src/source/mixer/MixerChannelConfiguration.java +++ b/src/main/java/io/github/dsheirer/source/mixer/MixerChannelConfiguration.java @@ -1,4 +1,4 @@ -package source.mixer; +package io.github.dsheirer.source.mixer; import javax.sound.sampled.Mixer; diff --git a/src/source/mixer/MixerManager.java b/src/main/java/io/github/dsheirer/source/mixer/MixerManager.java similarity index 95% rename from src/source/mixer/MixerManager.java rename to src/main/java/io/github/dsheirer/source/mixer/MixerManager.java index 2026e6c6..7fa74a20 100644 --- a/src/source/mixer/MixerManager.java +++ b/src/main/java/io/github/dsheirer/source/mixer/MixerManager.java @@ -15,14 +15,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.mixer; +package io.github.dsheirer.source.mixer; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.List; +import io.github.dsheirer.audio.AudioFormats; +import io.github.dsheirer.sample.adapter.ChannelShortAdapter; +import io.github.dsheirer.sample.adapter.ShortAdapter; +import io.github.dsheirer.source.config.SourceConfigMixer; +import io.github.dsheirer.source.config.SourceConfiguration; +import io.github.dsheirer.source.tuner.MixerTunerDataLine; +import io.github.dsheirer.source.tuner.MixerTunerType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioSystem; @@ -33,17 +36,12 @@ import javax.sound.sampled.Mixer; import javax.sound.sampled.Port; import javax.sound.sampled.SourceDataLine; import javax.sound.sampled.TargetDataLine; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import sample.adapter.ChannelShortAdapter; -import sample.adapter.ShortAdapter; -import source.config.SourceConfigMixer; -import source.config.SourceConfiguration; -import source.tuner.MixerTunerDataLine; -import source.tuner.MixerTunerType; -import audio.AudioFormats; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.List; public class MixerManager { @@ -63,7 +61,7 @@ public class MixerManager { RealMixerSource retVal = null; - if( config instanceof SourceConfigMixer ) + if( config instanceof SourceConfigMixer) { SourceConfigMixer mixerConfig = (SourceConfigMixer)config; @@ -103,7 +101,7 @@ public class MixerManager catch ( LineUnavailableException e ) { mLog.error( "couldn't get mixer data line " + - "for [" + mixerName + "] for channel [" + + "for [" + mixerName + "] for channel [" + channel.name() + "]", e ); } @@ -132,7 +130,7 @@ public class MixerManager catch ( LineUnavailableException e ) { mLog.error( "couldn't get mixer data line " + - "for [" + mixerName + "] for channel [" + + "for [" + mixerName + "] for channel [" + channel.name() + "]", e ); } } @@ -318,7 +316,7 @@ public class MixerManager } /** - * Returns enumset of SourceDataLine (audio output) channels + * Returns enumset of SourceDataLine (audio output) channels * (MONO and/or STEREO) supported by the mixer, or null if the mixer doesn't * have any source data lines. */ diff --git a/src/source/mixer/MixerSourceEditor.java b/src/main/java/io/github/dsheirer/source/mixer/MixerSourceEditor.java similarity index 76% rename from src/source/mixer/MixerSourceEditor.java rename to src/main/java/io/github/dsheirer/source/mixer/MixerSourceEditor.java index 11ad5516..b9630382 100644 --- a/src/source/mixer/MixerSourceEditor.java +++ b/src/main/java/io/github/dsheirer/source/mixer/MixerSourceEditor.java @@ -15,29 +15,24 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.mixer; +package io.github.dsheirer.source.mixer; -import gui.editor.Editor; +import io.github.dsheirer.controller.channel.Channel; +import io.github.dsheirer.gui.editor.Editor; +import io.github.dsheirer.source.SourceManager; +import io.github.dsheirer.source.config.SourceConfigMixer; +import io.github.dsheirer.source.config.SourceConfiguration; +import net.miginfocom.swing.MigLayout; +import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.EnumSet; -import javax.swing.DefaultComboBoxModel; -import javax.swing.JComboBox; -import javax.swing.JLabel; - -import net.miginfocom.swing.MigLayout; -import source.SourceManager; -import source.config.SourceConfigMixer; -import source.config.SourceConfiguration; -import source.mixer.MixerManager.InputMixerConfiguration; -import controller.channel.Channel; - public class MixerSourceEditor extends Editor { private static final long serialVersionUID = 1L; - private JComboBox mComboMixers; + private JComboBox mComboMixers; private JComboBoxmComboChannels; private SourceManager mSourceManager; @@ -52,16 +47,16 @@ public class MixerSourceEditor extends Editor { setLayout( new MigLayout( "insets 0 0 0 0,wrap 4", "[right][grow,fill][right][grow,fill]", "" ) ); - mComboMixers = new JComboBox(); - InputMixerConfiguration[] inputMixers = mSourceManager.getMixerManager().getInputMixers(); - mComboMixers.setModel( new DefaultComboBoxModel( inputMixers ) ); + mComboMixers = new JComboBox(); + MixerManager.InputMixerConfiguration[] inputMixers = mSourceManager.getMixerManager().getInputMixers(); + mComboMixers.setModel( new DefaultComboBoxModel( inputMixers ) ); mComboMixers.setEnabled( false ); mComboMixers.addActionListener( new ActionListener() { @Override public void actionPerformed( ActionEvent e ) { - InputMixerConfiguration selected = (InputMixerConfiguration)mComboMixers.getSelectedItem(); + MixerManager.InputMixerConfiguration selected = (MixerManager.InputMixerConfiguration)mComboMixers.getSelectedItem(); EnumSet channels = selected.getChannels(); @@ -79,7 +74,7 @@ public class MixerSourceEditor extends Editor mComboChannels = new JComboBox(); - InputMixerConfiguration selected = (InputMixerConfiguration)mComboMixers.getSelectedItem(); + MixerManager.InputMixerConfiguration selected = (MixerManager.InputMixerConfiguration)mComboMixers.getSelectedItem(); if( selected != null ) { @@ -115,11 +110,11 @@ public class MixerSourceEditor extends Editor SourceConfiguration config = item.getSourceConfiguration(); - if( config instanceof SourceConfigMixer ) + if( config instanceof SourceConfigMixer) { SourceConfigMixer mixer = (SourceConfigMixer)config; - for( InputMixerConfiguration inputMixer: mSourceManager.getMixerManager().getInputMixers() ) + for( MixerManager.InputMixerConfiguration inputMixer: mSourceManager.getMixerManager().getInputMixers() ) { if( inputMixer.getMixerName().equalsIgnoreCase( mixer.getMixer() ) ) { @@ -162,8 +157,8 @@ public class MixerSourceEditor extends Editor { SourceConfigMixer config = new SourceConfigMixer(); - InputMixerConfiguration selected = - (InputMixerConfiguration)mComboMixers.getSelectedItem(); + MixerManager.InputMixerConfiguration selected = + (MixerManager.InputMixerConfiguration)mComboMixers.getSelectedItem(); config.setMixer( selected.getMixerName() ); MixerChannel channel = (MixerChannel)mComboChannels.getSelectedItem(); diff --git a/src/source/mixer/RealMixerSource.java b/src/main/java/io/github/dsheirer/source/mixer/RealMixerSource.java similarity index 95% rename from src/source/mixer/RealMixerSource.java rename to src/main/java/io/github/dsheirer/source/mixer/RealMixerSource.java index 7f0dfba2..4135f790 100644 --- a/src/source/mixer/RealMixerSource.java +++ b/src/main/java/io/github/dsheirer/source/mixer/RealMixerSource.java @@ -15,18 +15,18 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.mixer; +package io.github.dsheirer.source.mixer; -import channel.heartbeat.Heartbeat; -import dsp.gain.AutomaticGainControl; +import io.github.dsheirer.channel.heartbeat.Heartbeat; +import io.github.dsheirer.dsp.gain.AutomaticGainControl; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.adapter.ISampleAdapter; +import io.github.dsheirer.sample.real.RealBuffer; +import io.github.dsheirer.source.RealSource; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; -import sample.adapter.ISampleAdapter; -import sample.real.RealBuffer; -import source.RealSource; -import source.SourceException; -import source.tuner.frequency.FrequencyChangeEvent; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioSystem; diff --git a/src/source/mixer/SystemMixerDevices.java b/src/main/java/io/github/dsheirer/source/mixer/SystemMixerDevices.java similarity index 98% rename from src/source/mixer/SystemMixerDevices.java rename to src/main/java/io/github/dsheirer/source/mixer/SystemMixerDevices.java index 9da3584c..84523ef2 100644 --- a/src/source/mixer/SystemMixerDevices.java +++ b/src/main/java/io/github/dsheirer/source/mixer/SystemMixerDevices.java @@ -15,9 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.mixer; - -import java.util.HashMap; +package io.github.dsheirer.source.mixer; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioSystem; @@ -26,6 +24,7 @@ import javax.sound.sampled.Line; import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.Mixer; import javax.sound.sampled.TargetDataLine; +import java.util.HashMap; /** * THIS CLASS IS SCHEDULED FOR DELETION ***************************** diff --git a/src/source/recording/Recording.java b/src/main/java/io/github/dsheirer/source/recording/Recording.java similarity index 82% rename from src/source/recording/Recording.java rename to src/main/java/io/github/dsheirer/source/recording/Recording.java index 9a228fc0..2d8c74ff 100644 --- a/src/source/recording/Recording.java +++ b/src/main/java/io/github/dsheirer/source/recording/Recording.java @@ -1,18 +1,18 @@ -package source.recording; +package io.github.dsheirer.source.recording; + +import io.github.dsheirer.settings.SettingsManager; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.tuner.ITunerChannelProvider; +import io.github.dsheirer.source.tuner.TunerChannel; +import io.github.dsheirer.source.tuner.TunerChannelSource; +import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent; +import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent.Event; +import io.github.dsheirer.source.tuner.frequency.IFrequencyChangeProcessor; import java.io.File; import java.util.ArrayList; import java.util.concurrent.RejectedExecutionException; -import settings.SettingsManager; -import source.SourceException; -import source.tuner.ITunerChannelProvider; -import source.tuner.TunerChannel; -import source.tuner.TunerChannelSource; -import source.tuner.frequency.FrequencyChangeEvent; -import source.tuner.frequency.FrequencyChangeEvent.Event; -import source.tuner.frequency.IFrequencyChangeProcessor; - public class Recording implements Comparable, IFrequencyChangeProcessor, ITunerChannelProvider diff --git a/src/main/java/io/github/dsheirer/source/recording/RecordingConfiguration.java b/src/main/java/io/github/dsheirer/source/recording/RecordingConfiguration.java new file mode 100644 index 00000000..7dea1236 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/recording/RecordingConfiguration.java @@ -0,0 +1,87 @@ +package io.github.dsheirer.source.recording; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; + +import java.io.File; + +@JacksonXmlRootElement(localName = "recording_configuration") +public class RecordingConfiguration +{ + private File mRecording; + private String mFilePath; + private String mAlias; + private long mCenterFrequency; + + public RecordingConfiguration() + { + mAlias = "New Recording"; + } + + public RecordingConfiguration(String filePath, String alias, long centerFrequency) + { + mFilePath = filePath; + mAlias = alias; + mCenterFrequency = centerFrequency; + + updateFile(); + } + + private void updateFile() + { + if(mFilePath != null) + { + try + { + mRecording = new File(mFilePath); + } + catch(Exception e) + { + throw new IllegalArgumentException("There was an error while " + + "accessing the recording source [" + mFilePath + "]", e); + } + } + } + + @JsonIgnore + public File getRecording() + { + return mRecording; + } + + @JacksonXmlProperty(isAttribute = true, localName = "file_path") + public String getFilePath() + { + return mFilePath; + } + + public void setFilePath(String filePath) + { + mFilePath = filePath; + + updateFile(); + } + + @JacksonXmlProperty(isAttribute = true, localName = "alias") + public String getAlias() + { + return mAlias; + } + + public void setAlias(String alias) + { + mAlias = alias; + } + + @JacksonXmlProperty(isAttribute = true, localName = "center_frequency") + public long getCenterFrequency() + { + return mCenterFrequency; + } + + public void setCenterFrequency(long frequency) + { + mCenterFrequency = frequency; + } +} diff --git a/src/source/recording/RecordingSourceManager.java b/src/main/java/io/github/dsheirer/source/recording/RecordingSourceManager.java similarity index 87% rename from src/source/recording/RecordingSourceManager.java rename to src/main/java/io/github/dsheirer/source/recording/RecordingSourceManager.java index 4a47c660..810b17e0 100644 --- a/src/source/recording/RecordingSourceManager.java +++ b/src/main/java/io/github/dsheirer/source/recording/RecordingSourceManager.java @@ -15,23 +15,22 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.recording; +package io.github.dsheirer.source.recording; + +import io.github.dsheirer.settings.SettingsManager; +import io.github.dsheirer.source.Source; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.config.SourceConfigRecording; +import io.github.dsheirer.source.config.SourceConfiguration; +import io.github.dsheirer.source.tuner.TunerChannel; +import io.github.dsheirer.source.tuner.TunerChannelSource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import settings.SettingsManager; -import source.Source; -import source.SourceException; -import source.config.SourceConfigRecording; -import source.config.SourceConfiguration; -import source.tuner.TunerChannel; -import source.tuner.TunerChannelSource; - public class RecordingSourceManager { private final static Logger mLog = @@ -51,12 +50,12 @@ public class RecordingSourceManager * Iterates current recordings to get a tuner channel source for the frequency * specified in the channel config's source config object */ - public Source getSource( SourceConfiguration config, int bandwidth ) + public Source getSource(SourceConfiguration config, int bandwidth ) throws SourceException { TunerChannelSource retVal = null; - if( config instanceof SourceConfigRecording ) + if( config instanceof SourceConfigRecording) { SourceConfigRecording configRecording = (SourceConfigRecording)config; @@ -73,7 +72,7 @@ public class RecordingSourceManager } else { - throw new SourceException( "Recording with alias name [" + + throw new SourceException( "Recording with alias name [" + configRecording.getRecordingAlias() + "] is not currently available" ); } } diff --git a/src/source/tuner/ITunerChannelProvider.java b/src/main/java/io/github/dsheirer/source/tuner/ITunerChannelProvider.java similarity index 94% rename from src/source/tuner/ITunerChannelProvider.java rename to src/main/java/io/github/dsheirer/source/tuner/ITunerChannelProvider.java index b3a69a63..92cb95fc 100644 --- a/src/source/tuner/ITunerChannelProvider.java +++ b/src/main/java/io/github/dsheirer/source/tuner/ITunerChannelProvider.java @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner; +package io.github.dsheirer.source.tuner; + +import io.github.dsheirer.source.SourceException; import java.util.concurrent.RejectedExecutionException; -import source.SourceException; - public interface ITunerChannelProvider { /** diff --git a/src/source/tuner/LibUSBTransferProcessor.java b/src/main/java/io/github/dsheirer/source/tuner/LibUSBTransferProcessor.java similarity index 96% rename from src/source/tuner/LibUSBTransferProcessor.java rename to src/main/java/io/github/dsheirer/source/tuner/LibUSBTransferProcessor.java index 205fce9f..09c10372 100644 --- a/src/source/tuner/LibUSBTransferProcessor.java +++ b/src/main/java/io/github/dsheirer/source/tuner/LibUSBTransferProcessor.java @@ -16,13 +16,13 @@ * along with this program. If not, see * ******************************************************************************/ -package source.tuner; +package io.github.dsheirer.source.tuner; +import io.github.dsheirer.source.tuner.usb.USBTransferProcessor; +import io.github.dsheirer.util.ThreadPool; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.usb4java.LibUsb; -import source.tuner.usb.USBTransferProcessor; -import util.ThreadPool; import java.nio.ByteBuffer; import java.util.List; diff --git a/src/source/tuner/MixerTuner.java b/src/main/java/io/github/dsheirer/source/tuner/MixerTuner.java similarity index 91% rename from src/source/tuner/MixerTuner.java rename to src/main/java/io/github/dsheirer/source/tuner/MixerTuner.java index 37f79bed..586ef6e3 100644 --- a/src/source/tuner/MixerTuner.java +++ b/src/main/java/io/github/dsheirer/source/tuner/MixerTuner.java @@ -15,20 +15,18 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner; - -import java.util.ArrayList; - -import javax.sound.sampled.TargetDataLine; +package io.github.dsheirer.source.tuner; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.adapter.ISampleAdapter; +import io.github.dsheirer.sample.complex.ComplexBuffer; +import io.github.dsheirer.sample.complex.ComplexSampleListListener; +import io.github.dsheirer.source.mixer.ComplexMixer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; -import sample.adapter.ISampleAdapter; -import sample.complex.ComplexBuffer; -import sample.complex.ComplexSampleListListener; -import source.mixer.ComplexMixer; +import javax.sound.sampled.TargetDataLine; +import java.util.ArrayList; public abstract class MixerTuner extends Tuner implements Listener { @@ -42,7 +40,7 @@ public abstract class MixerTuner extends Tuner implements Listener ******************************************************************************/ -package source.tuner; +package io.github.dsheirer.source.tuner; import javax.sound.sampled.TargetDataLine; diff --git a/src/source/tuner/MixerTunerType.java b/src/main/java/io/github/dsheirer/source/tuner/MixerTunerType.java similarity index 98% rename from src/source/tuner/MixerTunerType.java rename to src/main/java/io/github/dsheirer/source/tuner/MixerTunerType.java index 4504bd19..25a81176 100644 --- a/src/source/tuner/MixerTunerType.java +++ b/src/main/java/io/github/dsheirer/source/tuner/MixerTunerType.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner; +package io.github.dsheirer.source.tuner; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.Mixer; diff --git a/src/source/tuner/Tuner.java b/src/main/java/io/github/dsheirer/source/tuner/Tuner.java similarity index 92% rename from src/source/tuner/Tuner.java rename to src/main/java/io/github/dsheirer/source/tuner/Tuner.java index cd6a3e4a..8b74a58d 100644 --- a/src/source/tuner/Tuner.java +++ b/src/main/java/io/github/dsheirer/source/tuner/Tuner.java @@ -15,22 +15,21 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner; +package io.github.dsheirer.source.tuner; + +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.ComplexBuffer; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent; +import io.github.dsheirer.source.tuner.frequency.IFrequencyChangeProcessor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.RejectedExecutionException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import sample.Listener; -import sample.complex.ComplexBuffer; -import source.SourceException; -import source.tuner.frequency.FrequencyChangeEvent; -import source.tuner.frequency.IFrequencyChangeProcessor; - /** * Tuner - provides tuner channel sources, representing a channel frequency */ @@ -65,11 +64,11 @@ public abstract class Tuner implements ITunerChannelProvider { case NOTIFICATION_FREQUENCY_CHANGE: broadcast( new TunerEvent( Tuner.this, - source.tuner.TunerEvent.Event.FREQUENCY )); + TunerEvent.Event.FREQUENCY )); break; case NOTIFICATION_SAMPLE_RATE_CHANGE: broadcast( new TunerEvent( Tuner.this, - source.tuner.TunerEvent.Event.SAMPLE_RATE )); + TunerEvent.Event.SAMPLE_RATE )); break; default: break; diff --git a/src/source/tuner/TunerChannel.java b/src/main/java/io/github/dsheirer/source/tuner/TunerChannel.java similarity index 98% rename from src/source/tuner/TunerChannel.java rename to src/main/java/io/github/dsheirer/source/tuner/TunerChannel.java index 568e5424..cb17482a 100644 --- a/src/source/tuner/TunerChannel.java +++ b/src/main/java/io/github/dsheirer/source/tuner/TunerChannel.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner; +package io.github.dsheirer.source.tuner; public class TunerChannel implements Comparable { diff --git a/src/source/tuner/TunerChannelProvider.java b/src/main/java/io/github/dsheirer/source/tuner/TunerChannelProvider.java similarity index 86% rename from src/source/tuner/TunerChannelProvider.java rename to src/main/java/io/github/dsheirer/source/tuner/TunerChannelProvider.java index 8f53f144..e1de1a12 100644 --- a/src/source/tuner/TunerChannelProvider.java +++ b/src/main/java/io/github/dsheirer/source/tuner/TunerChannelProvider.java @@ -1,9 +1,9 @@ -package source.tuner; +package io.github.dsheirer.source.tuner; + +import io.github.dsheirer.source.SourceException; import java.util.concurrent.RejectedExecutionException; -import source.SourceException; - public interface TunerChannelProvider { /** diff --git a/src/source/tuner/TunerChannelSource.java b/src/main/java/io/github/dsheirer/source/tuner/TunerChannelSource.java similarity index 94% rename from src/source/tuner/TunerChannelSource.java rename to src/main/java/io/github/dsheirer/source/tuner/TunerChannelSource.java index ba7900b8..c577789e 100644 --- a/src/source/tuner/TunerChannelSource.java +++ b/src/main/java/io/github/dsheirer/source/tuner/TunerChannelSource.java @@ -16,29 +16,28 @@ * along with this program. If not, see * ******************************************************************************/ -package source.tuner; +package io.github.dsheirer.source.tuner; -import channel.heartbeat.Heartbeat; -import channel.heartbeat.IHeartbeatProvider; -import dsp.filter.FilterFactory; -import dsp.filter.Window.WindowType; -import dsp.filter.cic.ComplexPrimeCICDecimate; -import dsp.mixer.Oscillator; +import io.github.dsheirer.channel.heartbeat.Heartbeat; +import io.github.dsheirer.dsp.filter.FilterFactory; +import io.github.dsheirer.dsp.filter.Window.WindowType; +import io.github.dsheirer.dsp.filter.cic.ComplexPrimeCICDecimate; +import io.github.dsheirer.dsp.mixer.Oscillator; +import io.github.dsheirer.sample.Buffer; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.OverflowableTransferQueue; +import io.github.dsheirer.sample.complex.Complex; +import io.github.dsheirer.sample.complex.ComplexBuffer; +import io.github.dsheirer.sample.real.IOverflowListener; +import io.github.dsheirer.source.ComplexSource; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent; +import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent.Event; +import io.github.dsheirer.source.tuner.frequency.IFrequencyChangeListener; +import io.github.dsheirer.source.tuner.frequency.IFrequencyChangeProcessor; +import io.github.dsheirer.source.tuner.frequency.IFrequencyChangeProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Buffer; -import sample.Listener; -import sample.OverflowableTransferQueue; -import sample.complex.Complex; -import sample.complex.ComplexBuffer; -import sample.real.IOverflowListener; -import source.ComplexSource; -import source.SourceException; -import source.tuner.frequency.FrequencyChangeEvent; -import source.tuner.frequency.FrequencyChangeEvent.Event; -import source.tuner.frequency.IFrequencyChangeListener; -import source.tuner.frequency.IFrequencyChangeProcessor; -import source.tuner.frequency.IFrequencyChangeProvider; import java.util.ArrayList; import java.util.List; diff --git a/src/source/tuner/TunerClass.java b/src/main/java/io/github/dsheirer/source/tuner/TunerClass.java similarity index 99% rename from src/source/tuner/TunerClass.java rename to src/main/java/io/github/dsheirer/source/tuner/TunerClass.java index 124aefe5..c255fc4b 100644 --- a/src/source/tuner/TunerClass.java +++ b/src/main/java/io/github/dsheirer/source/tuner/TunerClass.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner; +package io.github.dsheirer.source.tuner; import javax.usb.UsbDeviceDescriptor; diff --git a/src/source/tuner/TunerController.java b/src/main/java/io/github/dsheirer/source/tuner/TunerController.java similarity index 96% rename from src/source/tuner/TunerController.java rename to src/main/java/io/github/dsheirer/source/tuner/TunerController.java index 9290ab11..116459ce 100644 --- a/src/source/tuner/TunerController.java +++ b/src/main/java/io/github/dsheirer/source/tuner/TunerController.java @@ -15,17 +15,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner; +package io.github.dsheirer.source.tuner; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; +import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent; +import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent.Event; +import io.github.dsheirer.source.tuner.frequency.FrequencyController; +import io.github.dsheirer.source.tuner.frequency.FrequencyController.Tunable; +import io.github.dsheirer.source.tuner.frequency.IFrequencyChangeProcessor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import source.SourceException; -import source.tuner.configuration.TunerConfiguration; -import source.tuner.frequency.FrequencyChangeEvent; -import source.tuner.frequency.FrequencyChangeEvent.Event; -import source.tuner.frequency.FrequencyController; -import source.tuner.frequency.FrequencyController.Tunable; -import source.tuner.frequency.IFrequencyChangeProcessor; import java.util.SortedSet; import java.util.concurrent.ConcurrentSkipListSet; diff --git a/src/source/tuner/TunerEditor.java b/src/main/java/io/github/dsheirer/source/tuner/TunerEditor.java similarity index 94% rename from src/source/tuner/TunerEditor.java rename to src/main/java/io/github/dsheirer/source/tuner/TunerEditor.java index f1a0d972..4d30bd8a 100644 --- a/src/source/tuner/TunerEditor.java +++ b/src/main/java/io/github/dsheirer/source/tuner/TunerEditor.java @@ -16,38 +16,26 @@ * along with this program. If not, see ******************************************************************************/ -package source.tuner; - -import gui.control.JFrequencyControl; -import gui.editor.Editor; -import gui.editor.EmptyEditor; - -import java.awt.Dimension; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.JButton; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JTable; -import javax.swing.RowFilter; -import javax.swing.ScrollPaneConstants; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; -import javax.swing.table.TableRowSorter; +package io.github.dsheirer.source.tuner; +import com.jidesoft.swing.JideSplitPane; +import io.github.dsheirer.gui.control.JFrequencyControl; +import io.github.dsheirer.gui.editor.Editor; +import io.github.dsheirer.gui.editor.EmptyEditor; +import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; +import io.github.dsheirer.source.tuner.configuration.TunerConfigurationFactory; +import io.github.dsheirer.source.tuner.configuration.TunerConfigurationModel; import net.miginfocom.swing.MigLayout; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import source.tuner.configuration.TunerConfiguration; -import source.tuner.configuration.TunerConfigurationFactory; -import source.tuner.configuration.TunerConfigurationModel; - -import com.jidesoft.swing.JideSplitPane; +import javax.swing.*; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import javax.swing.table.TableRowSorter; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; public class TunerEditor extends Editor { diff --git a/src/source/tuner/TunerEvent.java b/src/main/java/io/github/dsheirer/source/tuner/TunerEvent.java similarity index 91% rename from src/source/tuner/TunerEvent.java rename to src/main/java/io/github/dsheirer/source/tuner/TunerEvent.java index f34a1fd4..3a0e0111 100644 --- a/src/source/tuner/TunerEvent.java +++ b/src/main/java/io/github/dsheirer/source/tuner/TunerEvent.java @@ -1,4 +1,4 @@ -package source.tuner; +package io.github.dsheirer.source.tuner; public class TunerEvent { diff --git a/src/source/tuner/TunerManager.java b/src/main/java/io/github/dsheirer/source/tuner/TunerManager.java similarity index 94% rename from src/source/tuner/TunerManager.java rename to src/main/java/io/github/dsheirer/source/tuner/TunerManager.java index b5181c26..5af7215e 100644 --- a/src/source/tuner/TunerManager.java +++ b/src/main/java/io/github/dsheirer/source/tuner/TunerManager.java @@ -16,27 +16,27 @@ * along with this program. If not, see * ******************************************************************************/ -package source.tuner; +package io.github.dsheirer.source.tuner; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.mixer.MixerManager; +import io.github.dsheirer.source.tuner.airspy.AirspyTuner; +import io.github.dsheirer.source.tuner.airspy.AirspyTunerController; +import io.github.dsheirer.source.tuner.fcd.FCDTuner; +import io.github.dsheirer.source.tuner.fcd.proV1.FCD1TunerController; +import io.github.dsheirer.source.tuner.fcd.proplusV2.FCD2TunerController; +import io.github.dsheirer.source.tuner.hackrf.HackRFTuner; +import io.github.dsheirer.source.tuner.hackrf.HackRFTunerController; +import io.github.dsheirer.source.tuner.rtl.RTL2832Tuner; +import io.github.dsheirer.source.tuner.rtl.RTL2832TunerController; +import io.github.dsheirer.source.tuner.rtl.e4k.E4KTunerController; +import io.github.dsheirer.source.tuner.rtl.r820t.R820TTunerController; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.usb4java.Device; import org.usb4java.DeviceDescriptor; import org.usb4java.DeviceList; import org.usb4java.LibUsb; -import source.SourceException; -import source.mixer.MixerManager; -import source.tuner.airspy.AirspyTuner; -import source.tuner.airspy.AirspyTunerController; -import source.tuner.fcd.FCDTuner; -import source.tuner.fcd.proV1.FCD1TunerController; -import source.tuner.fcd.proplusV2.FCD2TunerController; -import source.tuner.hackrf.HackRFTuner; -import source.tuner.hackrf.HackRFTunerController; -import source.tuner.rtl.RTL2832Tuner; -import source.tuner.rtl.RTL2832TunerController; -import source.tuner.rtl.e4k.E4KTunerController; -import source.tuner.rtl.r820t.R820TTunerController; import java.util.Collection; diff --git a/src/source/tuner/TunerModel.java b/src/main/java/io/github/dsheirer/source/tuner/TunerModel.java similarity index 92% rename from src/source/tuner/TunerModel.java rename to src/main/java/io/github/dsheirer/source/tuner/TunerModel.java index 09a74804..3b7aa297 100644 --- a/src/source/tuner/TunerModel.java +++ b/src/main/java/io/github/dsheirer/source/tuner/TunerModel.java @@ -1,24 +1,22 @@ -package source.tuner; +package io.github.dsheirer.source.tuner; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.source.Source; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.config.SourceConfigTuner; +import io.github.dsheirer.source.tuner.TunerEvent.Event; +import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; +import io.github.dsheirer.source.tuner.configuration.TunerConfigurationModel; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.swing.table.AbstractTableModel; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.concurrent.RejectedExecutionException; -import javax.swing.table.AbstractTableModel; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import sample.Listener; -import source.Source; -import source.SourceException; -import source.config.SourceConfigTuner; -import source.tuner.TunerEvent.Event; -import source.tuner.configuration.TunerConfiguration; -import source.tuner.configuration.TunerConfigurationModel; - public class TunerModel extends AbstractTableModel implements Listener { private static final long serialVersionUID = 1L; @@ -261,7 +259,7 @@ public class TunerModel extends AbstractTableModel implements Listener ******************************************************************************/ -package source.tuner; +package io.github.dsheirer.source.tuner; -import gui.control.JFrequencyControl; -import gui.editor.Editor; +import io.github.dsheirer.controller.channel.Channel; +import io.github.dsheirer.gui.control.JFrequencyControl; +import io.github.dsheirer.gui.editor.Editor; +import io.github.dsheirer.source.config.SourceConfigTuner; +import io.github.dsheirer.source.config.SourceConfiguration; +import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent; +import io.github.dsheirer.source.tuner.frequency.IFrequencyChangeProcessor; import net.miginfocom.swing.MigLayout; -import source.config.SourceConfigTuner; -import source.config.SourceConfiguration; -import source.tuner.frequency.FrequencyChangeEvent; -import source.tuner.frequency.IFrequencyChangeProcessor; -import controller.channel.Channel; public class TunerSourceEditor extends Editor { diff --git a/src/source/tuner/TunerSpectralDisplayManager.java b/src/main/java/io/github/dsheirer/source/tuner/TunerSpectralDisplayManager.java similarity index 75% rename from src/source/tuner/TunerSpectralDisplayManager.java rename to src/main/java/io/github/dsheirer/source/tuner/TunerSpectralDisplayManager.java index 2f595bbd..ed53b8e2 100644 --- a/src/source/tuner/TunerSpectralDisplayManager.java +++ b/src/main/java/io/github/dsheirer/source/tuner/TunerSpectralDisplayManager.java @@ -1,13 +1,13 @@ -package source.tuner; +package io.github.dsheirer.source.tuner; -import java.awt.EventQueue; +import io.github.dsheirer.controller.channel.ChannelModel; +import io.github.dsheirer.controller.channel.ChannelProcessingManager; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.settings.SettingsManager; +import io.github.dsheirer.spectrum.SpectralDisplayPanel; +import io.github.dsheirer.spectrum.SpectrumFrame; -import sample.Listener; -import settings.SettingsManager; -import spectrum.SpectralDisplayPanel; -import spectrum.SpectrumFrame; -import controller.channel.ChannelModel; -import controller.channel.ChannelProcessingManager; +import java.awt.*; public class TunerSpectralDisplayManager implements Listener { diff --git a/src/source/tuner/TunerType.java b/src/main/java/io/github/dsheirer/source/tuner/TunerType.java similarity index 97% rename from src/source/tuner/TunerType.java rename to src/main/java/io/github/dsheirer/source/tuner/TunerType.java index 65b293f3..93718fdb 100644 --- a/src/source/tuner/TunerType.java +++ b/src/main/java/io/github/dsheirer/source/tuner/TunerType.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner; +package io.github.dsheirer.source.tuner; public enum TunerType { diff --git a/src/source/tuner/TunerViewPanel.java b/src/main/java/io/github/dsheirer/source/tuner/TunerViewPanel.java similarity index 93% rename from src/source/tuner/TunerViewPanel.java rename to src/main/java/io/github/dsheirer/source/tuner/TunerViewPanel.java index 306f2adb..f919377d 100644 --- a/src/source/tuner/TunerViewPanel.java +++ b/src/main/java/io/github/dsheirer/source/tuner/TunerViewPanel.java @@ -16,37 +16,25 @@ * along with this program. If not, see ******************************************************************************/ -package source.tuner; +package io.github.dsheirer.source.tuner; -import java.awt.Color; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.util.ArrayList; -import java.util.List; +import com.jidesoft.swing.JideSplitPane; +import io.github.dsheirer.source.tuner.TunerEvent.Event; +import net.miginfocom.swing.MigLayout; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JTable; -import javax.swing.ListSelectionModel; -import javax.swing.RowSorter; -import javax.swing.SortOrder; +import javax.swing.*; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.TableCellRenderer; import javax.swing.table.TableRowSorter; - -import net.miginfocom.swing.MigLayout; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import source.tuner.TunerEvent.Event; - -import com.jidesoft.swing.JideSplitPane; +import java.awt.*; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.ArrayList; +import java.util.List; public class TunerViewPanel extends JPanel { diff --git a/src/source/tuner/airspy/AirspyDeviceInformation.java b/src/main/java/io/github/dsheirer/source/tuner/airspy/AirspyDeviceInformation.java similarity index 93% rename from src/source/tuner/airspy/AirspyDeviceInformation.java rename to src/main/java/io/github/dsheirer/source/tuner/airspy/AirspyDeviceInformation.java index 313a1acf..2b6b2be3 100644 --- a/src/source/tuner/airspy/AirspyDeviceInformation.java +++ b/src/main/java/io/github/dsheirer/source/tuner/airspy/AirspyDeviceInformation.java @@ -1,18 +1,16 @@ -package source.tuner.airspy; - -import java.util.Arrays; +package io.github.dsheirer.source.tuner.airspy; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import source.tuner.airspy.AirspyTunerController.BoardID; +import java.util.Arrays; public class AirspyDeviceInformation { private final static Logger mLog = LoggerFactory.getLogger( AirspyDeviceInformation.class ); - private BoardID mBoardID = BoardID.UNKNOWN; + private AirspyTunerController.BoardID mBoardID = AirspyTunerController.BoardID.UNKNOWN; private String mFirmwareVersion = "Unknown"; private String mPartNumber = "Unknown"; private String mSerialNumber = "Unknown"; @@ -27,10 +25,10 @@ public class AirspyDeviceInformation public void setBoardID( int boardID ) { - mBoardID = BoardID.fromValue( boardID ); + mBoardID = AirspyTunerController.BoardID.fromValue( boardID ); } - public BoardID getBoardID() + public AirspyTunerController.BoardID getBoardID() { return mBoardID; } @@ -86,7 +84,7 @@ public class AirspyDeviceInformation StringBuilder serial = new StringBuilder(); //Note: current airspy library only exposes 64-bits of serial number - //address space, but appears to have room for 128-bits. We won't + //address space, but appears to have room for 128-bits. We won't //add the first 64 bits if it's zeros if( !( data[ 8 ] == 0 && data[ 9 ] == 0 && data[ 10 ] == 0 && data[ 11 ] == 0 ) ) { diff --git a/src/source/tuner/airspy/AirspySampleAdapter.java b/src/main/java/io/github/dsheirer/source/tuner/airspy/AirspySampleAdapter.java similarity index 94% rename from src/source/tuner/airspy/AirspySampleAdapter.java rename to src/main/java/io/github/dsheirer/source/tuner/airspy/AirspySampleAdapter.java index deab9119..fa0fa459 100644 --- a/src/source/tuner/airspy/AirspySampleAdapter.java +++ b/src/main/java/io/github/dsheirer/source/tuner/airspy/AirspySampleAdapter.java @@ -16,11 +16,11 @@ * along with this program. If not, see * ******************************************************************************/ -package source.tuner.airspy; +package io.github.dsheirer.source.tuner.airspy; -import dsp.filter.dc.DCRemovalFilter_RB; -import dsp.filter.hilbert.HilbertTransform; -import sample.adapter.ISampleAdapter; +import io.github.dsheirer.dsp.filter.dc.DCRemovalFilter_RB; +import io.github.dsheirer.dsp.filter.hilbert.HilbertTransform; +import io.github.dsheirer.sample.adapter.ISampleAdapter; public class AirspySampleAdapter implements ISampleAdapter { diff --git a/src/source/tuner/airspy/AirspySampleRate.java b/src/main/java/io/github/dsheirer/source/tuner/airspy/AirspySampleRate.java similarity index 89% rename from src/source/tuner/airspy/AirspySampleRate.java rename to src/main/java/io/github/dsheirer/source/tuner/airspy/AirspySampleRate.java index 0a9dc2a6..4d1b3afb 100644 --- a/src/source/tuner/airspy/AirspySampleRate.java +++ b/src/main/java/io/github/dsheirer/source/tuner/airspy/AirspySampleRate.java @@ -1,4 +1,4 @@ -package source.tuner.airspy; +package io.github.dsheirer.source.tuner.airspy; public class AirspySampleRate { diff --git a/src/source/tuner/airspy/AirspyTuner.java b/src/main/java/io/github/dsheirer/source/tuner/airspy/AirspyTuner.java similarity index 84% rename from src/source/tuner/airspy/AirspyTuner.java rename to src/main/java/io/github/dsheirer/source/tuner/airspy/AirspyTuner.java index 48c06d3b..ba1f5ad1 100644 --- a/src/source/tuner/airspy/AirspyTuner.java +++ b/src/main/java/io/github/dsheirer/source/tuner/airspy/AirspyTuner.java @@ -15,23 +15,22 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner.airspy; - -import java.util.concurrent.RejectedExecutionException; +package io.github.dsheirer.source.tuner.airspy; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.ComplexBuffer; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.tuner.Tuner; +import io.github.dsheirer.source.tuner.TunerChannel; +import io.github.dsheirer.source.tuner.TunerChannelSource; +import io.github.dsheirer.source.tuner.TunerClass; +import io.github.dsheirer.source.tuner.TunerEvent; +import io.github.dsheirer.source.tuner.TunerType; +import io.github.dsheirer.source.tuner.airspy.AirspyTunerController.BoardID; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; -import sample.complex.ComplexBuffer; -import source.SourceException; -import source.tuner.Tuner; -import source.tuner.TunerChannel; -import source.tuner.TunerChannelSource; -import source.tuner.TunerClass; -import source.tuner.TunerEvent; -import source.tuner.TunerType; -import source.tuner.airspy.AirspyTunerController.BoardID; +import java.util.concurrent.RejectedExecutionException; public class AirspyTuner extends Tuner { diff --git a/src/main/java/io/github/dsheirer/source/tuner/airspy/AirspyTunerConfiguration.java b/src/main/java/io/github/dsheirer/source/tuner/airspy/AirspyTunerConfiguration.java new file mode 100644 index 00000000..4c5ac346 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/airspy/AirspyTunerConfiguration.java @@ -0,0 +1,142 @@ +/* + * ********************************************************************************************************************* + * 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 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 + * ********************************************************************************************************************* + */ +package io.github.dsheirer.source.tuner.airspy; + +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.github.dsheirer.source.tuner.TunerType; +import io.github.dsheirer.source.tuner.airspy.AirspyTunerController.Gain; +import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; + +public class AirspyTunerConfiguration extends TunerConfiguration +{ + private int mSampleRate = AirspyTunerController.DEFAULT_SAMPLE_RATE.getRate(); + private Gain mGain = AirspyTunerController.LINEARITY_GAIN_DEFAULT; + private int mIFGain = AirspyTunerController.IF_GAIN_DEFAULT; + private int mMixerGain = AirspyTunerController.MIXER_GAIN_DEFAULT; + private int mLNAGain = AirspyTunerController.LNA_GAIN_DEFAULT; + private double mFrequencyCorrection = 0.0d; + + private boolean mMixerAGC = false; + private boolean mLNAAGC = false; + + /** + * Default constructor for JAXB + */ + public AirspyTunerConfiguration() + { + } + + public AirspyTunerConfiguration( String uniqueID, String name ) + { + super( uniqueID, name ); + } + + @Override + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + public TunerType getTunerType() + { + return TunerType.AIRSPY_R820T; + } + + @JacksonXmlProperty(isAttribute = true, localName = "sample_rate") + public int getSampleRate() + { + return mSampleRate; + } + + public void setSampleRate( int sampleRate ) + { + mSampleRate = sampleRate; + } + + @JacksonXmlProperty(isAttribute = true, localName = "gain") + public Gain getGain() + { + return mGain; + } + + public void setGain( Gain gain ) + { + mGain = gain; + } + + @JacksonXmlProperty(isAttribute = true, localName = "if_gain") + public int getIFGain() + { + return mIFGain; + } + + public void setIFGain( int gain ) + { + mIFGain = gain; + } + + @JacksonXmlProperty(isAttribute = true, localName = "mixer_gain") + public int getMixerGain() + { + return mMixerGain; + } + + public void setMixerGain( int gain ) + { + mMixerGain = gain; + } + + @JacksonXmlProperty(isAttribute = true, localName = "lna_gain") + public int getLNAGain() + { + return mLNAGain; + } + + public void setLNAGain( int gain ) + { + mLNAGain = gain; + } + + @JacksonXmlProperty(isAttribute = true, localName = "mixer_agc") + public boolean isMixerAGC() + { + return mMixerAGC; + } + + public void setMixerAGC( boolean enabled ) + { + mMixerAGC = enabled; + } + + @JacksonXmlProperty(isAttribute = true, localName = "lna_agc") + public boolean isLNAAGC() + { + return mLNAAGC; + } + + public void setLNAAGC( boolean enabled ) + { + mLNAAGC = enabled; + } + + @JacksonXmlProperty(isAttribute = true, localName = "frequency_correction") + public double getFrequencyCorrection() + { + return mFrequencyCorrection; + } + + public void setFrequencyCorrection( double value ) + { + mFrequencyCorrection = value; + } +} diff --git a/src/source/tuner/airspy/AirspyTunerController.java b/src/main/java/io/github/dsheirer/source/tuner/airspy/AirspyTunerController.java similarity index 98% rename from src/source/tuner/airspy/AirspyTunerController.java rename to src/main/java/io/github/dsheirer/source/tuner/airspy/AirspyTunerController.java index f8362bf6..be1163d6 100644 --- a/src/source/tuner/airspy/AirspyTunerController.java +++ b/src/main/java/io/github/dsheirer/source/tuner/airspy/AirspyTunerController.java @@ -1,7 +1,11 @@ -package source.tuner.airspy; +package io.github.dsheirer.source.tuner.airspy; -import dsp.filter.dc.DCRemovalFilter_RB; -import dsp.filter.hilbert.HilbertTransform; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.ComplexBuffer; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.tuner.TunerController; +import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; +import io.github.dsheirer.source.tuner.usb.USBTransferProcessor; import org.apache.commons.io.EndianUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -9,16 +13,6 @@ import org.usb4java.Device; import org.usb4java.DeviceHandle; import org.usb4java.LibUsb; import org.usb4java.LibUsbException; -import org.usb4java.Transfer; -import org.usb4java.TransferCallback; -import sample.Broadcaster; -import sample.Listener; -import sample.complex.ComplexBuffer; -import source.SourceException; -import source.tuner.TunerController; -import source.tuner.configuration.TunerConfiguration; -import source.tuner.usb.USBTransferProcessor; -import util.ThreadPool; import javax.usb.UsbException; import java.nio.ByteBuffer; @@ -27,10 +21,6 @@ import java.text.DecimalFormat; import java.util.ArrayList; import java.util.EnumSet; import java.util.List; -import java.util.concurrent.LinkedTransferQueue; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; /** * SDR Trunk diff --git a/src/source/tuner/airspy/AirspyTunerEditor.java b/src/main/java/io/github/dsheirer/source/tuner/airspy/AirspyTunerEditor.java similarity index 95% rename from src/source/tuner/airspy/AirspyTunerEditor.java rename to src/main/java/io/github/dsheirer/source/tuner/airspy/AirspyTunerEditor.java index eda85985..922f98f0 100644 --- a/src/source/tuner/airspy/AirspyTunerEditor.java +++ b/src/main/java/io/github/dsheirer/source/tuner/airspy/AirspyTunerEditor.java @@ -15,8 +15,24 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner.airspy; +package io.github.dsheirer.source.tuner.airspy; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.tuner.airspy.AirspyTunerController.Gain; +import io.github.dsheirer.source.tuner.airspy.AirspyTunerController.GainMode; +import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; +import io.github.dsheirer.source.tuner.configuration.TunerConfigurationEditor; +import io.github.dsheirer.source.tuner.configuration.TunerConfigurationEvent; +import io.github.dsheirer.source.tuner.configuration.TunerConfigurationModel; +import net.miginfocom.swing.MigLayout; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.usb4java.LibUsbException; + +import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import javax.usb.UsbException; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusEvent; @@ -24,38 +40,6 @@ import java.awt.event.FocusListener; import java.text.DecimalFormat; import java.util.List; -import javax.swing.DefaultComboBoxModel; -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JComboBox; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JSeparator; -import javax.swing.JSlider; -import javax.swing.JSpinner; -import javax.swing.JTextField; -import javax.swing.SpinnerModel; -import javax.swing.SpinnerNumberModel; -import javax.swing.SwingConstants; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.usb.UsbException; - -import net.miginfocom.swing.MigLayout; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.usb4java.LibUsbException; - -import source.SourceException; -import source.tuner.airspy.AirspyTunerController.Gain; -import source.tuner.airspy.AirspyTunerController.GainMode; -import source.tuner.configuration.TunerConfiguration; -import source.tuner.configuration.TunerConfigurationEditor; -import source.tuner.configuration.TunerConfigurationEvent; -import source.tuner.configuration.TunerConfigurationModel; -import source.tuner.configuration.TunerConfigurationEvent.Event; - public class AirspyTunerEditor extends TunerConfigurationEditor { private static final long serialVersionUID = 1L; @@ -576,7 +560,7 @@ public class AirspyTunerEditor extends TunerConfigurationEditor config.setMixerAGC( mMixerAGC.isSelected() ); config.setLNAAGC( mLNAAGC.isSelected() ); - getTunerConfigurationModel().broadcast( new TunerConfigurationEvent( config, Event.CHANGE ) ); + getTunerConfigurationModel().broadcast( new TunerConfigurationEvent( config, TunerConfigurationEvent.Event.CHANGE ) ); } } diff --git a/src/main/java/io/github/dsheirer/source/tuner/configuration/TunerConfiguration.java b/src/main/java/io/github/dsheirer/source/tuner/configuration/TunerConfiguration.java new file mode 100644 index 00000000..876773e0 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/configuration/TunerConfiguration.java @@ -0,0 +1,126 @@ +/* + * ********************************************************************************************************************* + * 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 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 + * ********************************************************************************************************************* + */ +package io.github.dsheirer.source.tuner.configuration; + +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.source.tuner.TunerType; +import io.github.dsheirer.source.tuner.airspy.AirspyTunerConfiguration; +import io.github.dsheirer.source.tuner.fcd.proV1.FCD1TunerConfiguration; +import io.github.dsheirer.source.tuner.fcd.proplusV2.FCD2TunerConfiguration; +import io.github.dsheirer.source.tuner.hackrf.HackRFTunerConfiguration; +import io.github.dsheirer.source.tuner.rtl.e4k.E4KTunerConfiguration; +import io.github.dsheirer.source.tuner.rtl.r820t.R820TTunerConfiguration; + +/** + * Abstract class to hold a named configuration for a specific type of tuner + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include= JsonTypeInfo.As.PROPERTY, property="type") +@JsonSubTypes({ + @JsonSubTypes.Type(value=AirspyTunerConfiguration.class, name="airspyTunerConfiguration"), + @JsonSubTypes.Type(value=E4KTunerConfiguration.class, name="e4KTunerConfiguration"), + @JsonSubTypes.Type(value=FCD1TunerConfiguration.class, name="fcd1TunerConfiguration"), + @JsonSubTypes.Type(value=FCD2TunerConfiguration.class, name="fcd2TunerConfiguration"), + @JsonSubTypes.Type(value=HackRFTunerConfiguration.class, name="hackRFTunerConfiguration"), + @JsonSubTypes.Type(value=R820TTunerConfiguration.class, name="r820TTunerConfiguration"), +}) +@JacksonXmlRootElement( localName = "tuner_configuration" ) +public abstract class TunerConfiguration +{ + protected String mName; + protected String mUniqueID; + protected boolean mAssigned; + protected long mFrequency; + + /** + * Default constructor to support JAXB + */ + public TunerConfiguration() + { + } + + /** + * Normal constructor + */ + public TunerConfiguration(String uniqueID, String name) + { + mUniqueID = uniqueID; + mName = name; + } + + public String toString() + { + return mName; + } + + @JacksonXmlProperty(isAttribute = true, localName = "name") + public String getName() + { + return mName; + } + + public void setName(String name) + { + mName = name; + } + + @JacksonXmlProperty(isAttribute = true, localName = "unique_id") + public String getUniqueID() + { + return mUniqueID; + } + + public void setUniqueID(String id) + { + mUniqueID = id; + ; + } + + @JacksonXmlProperty(isAttribute = true, localName = "assigned") + public boolean isAssigned() + { + return mAssigned; + } + + public void setAssigned(boolean assigned) + { + mAssigned = assigned; + } + + @JacksonXmlProperty(isAttribute = true, localName = "frequency") + public long getFrequency() + { + return mFrequency; + } + + public void setFrequency(long frequency) + { + mFrequency = frequency; + } + + @JsonIgnore + public abstract TunerType getTunerType(); + + //Below is maintained for compatibility with javax.xml.bind serialization of the settings file. + //This can be removed if/once there is a new version of the settings. + @JacksonXmlProperty(isAttribute = true, localName = "tuner_type") + public String getLegacyAttribute(){ return null; } + public void setLegacyAttribute(String bonkers) { } +} diff --git a/src/source/tuner/configuration/TunerConfigurationEditor.java b/src/main/java/io/github/dsheirer/source/tuner/configuration/TunerConfigurationEditor.java similarity index 80% rename from src/source/tuner/configuration/TunerConfigurationEditor.java rename to src/main/java/io/github/dsheirer/source/tuner/configuration/TunerConfigurationEditor.java index 1c02f4b0..6c8af503 100644 --- a/src/source/tuner/configuration/TunerConfigurationEditor.java +++ b/src/main/java/io/github/dsheirer/source/tuner/configuration/TunerConfigurationEditor.java @@ -1,6 +1,6 @@ -package source.tuner.configuration; +package io.github.dsheirer.source.tuner.configuration; -import gui.editor.Editor; +import io.github.dsheirer.gui.editor.Editor; public abstract class TunerConfigurationEditor extends Editor { diff --git a/src/source/tuner/configuration/TunerConfigurationEvent.java b/src/main/java/io/github/dsheirer/source/tuner/configuration/TunerConfigurationEvent.java similarity index 89% rename from src/source/tuner/configuration/TunerConfigurationEvent.java rename to src/main/java/io/github/dsheirer/source/tuner/configuration/TunerConfigurationEvent.java index 02a0769d..8ec31f97 100644 --- a/src/source/tuner/configuration/TunerConfigurationEvent.java +++ b/src/main/java/io/github/dsheirer/source/tuner/configuration/TunerConfigurationEvent.java @@ -1,4 +1,4 @@ -package source.tuner.configuration; +package io.github.dsheirer.source.tuner.configuration; public class TunerConfigurationEvent { diff --git a/src/source/tuner/configuration/TunerConfigurationFactory.java b/src/main/java/io/github/dsheirer/source/tuner/configuration/TunerConfigurationFactory.java similarity index 62% rename from src/source/tuner/configuration/TunerConfigurationFactory.java rename to src/main/java/io/github/dsheirer/source/tuner/configuration/TunerConfigurationFactory.java index 181440b4..71f8a164 100644 --- a/src/source/tuner/configuration/TunerConfigurationFactory.java +++ b/src/main/java/io/github/dsheirer/source/tuner/configuration/TunerConfigurationFactory.java @@ -16,35 +16,35 @@ * along with this program. If not, see ******************************************************************************/ -package source.tuner.configuration; +package io.github.dsheirer.source.tuner.configuration; -import gui.editor.Editor; -import source.tuner.Tuner; -import source.tuner.TunerType; -import source.tuner.airspy.AirspyTuner; -import source.tuner.airspy.AirspyTunerConfiguration; -import source.tuner.airspy.AirspyTunerEditor; -import source.tuner.fcd.FCDTuner; -import source.tuner.fcd.proV1.FCD1TunerConfiguration; -import source.tuner.fcd.proV1.FCD1TunerEditor; -import source.tuner.fcd.proplusV2.FCD2TunerConfiguration; -import source.tuner.fcd.proplusV2.FCD2TunerEditor; -import source.tuner.hackrf.HackRFTuner; -import source.tuner.hackrf.HackRFTunerConfiguration; -import source.tuner.hackrf.HackRFTunerEditor; -import source.tuner.rtl.RTL2832Tuner; -import source.tuner.rtl.e4k.E4KTunerConfiguration; -import source.tuner.rtl.e4k.E4KTunerEditor; -import source.tuner.rtl.r820t.R820TTunerConfiguration; -import source.tuner.rtl.r820t.R820TTunerEditor; +import io.github.dsheirer.gui.editor.Editor; +import io.github.dsheirer.source.tuner.Tuner; +import io.github.dsheirer.source.tuner.TunerType; +import io.github.dsheirer.source.tuner.airspy.AirspyTuner; +import io.github.dsheirer.source.tuner.airspy.AirspyTunerConfiguration; +import io.github.dsheirer.source.tuner.airspy.AirspyTunerEditor; +import io.github.dsheirer.source.tuner.fcd.FCDTuner; +import io.github.dsheirer.source.tuner.fcd.proV1.FCD1TunerConfiguration; +import io.github.dsheirer.source.tuner.fcd.proV1.FCD1TunerEditor; +import io.github.dsheirer.source.tuner.fcd.proplusV2.FCD2TunerConfiguration; +import io.github.dsheirer.source.tuner.fcd.proplusV2.FCD2TunerEditor; +import io.github.dsheirer.source.tuner.hackrf.HackRFTuner; +import io.github.dsheirer.source.tuner.hackrf.HackRFTunerConfiguration; +import io.github.dsheirer.source.tuner.hackrf.HackRFTunerEditor; +import io.github.dsheirer.source.tuner.rtl.RTL2832Tuner; +import io.github.dsheirer.source.tuner.rtl.e4k.E4KTunerConfiguration; +import io.github.dsheirer.source.tuner.rtl.e4k.E4KTunerEditor; +import io.github.dsheirer.source.tuner.rtl.r820t.R820TTunerConfiguration; +import io.github.dsheirer.source.tuner.rtl.r820t.R820TTunerEditor; public class TunerConfigurationFactory { /** * Creates a tuner configuration for the specified tuner type, unique ID and name */ - public static TunerConfiguration getTunerConfiguration( TunerType type, String uniqueID, - String name ) + public static TunerConfiguration getTunerConfiguration(TunerType type, String uniqueID, + String name ) { switch( type ) { @@ -70,7 +70,7 @@ public class TunerConfigurationFactory /** * Creates a tuner editor gui for the specified tuner */ - public static Editor getEditor( Tuner tuner, TunerConfigurationModel model ) + public static Editor getEditor(Tuner tuner, TunerConfigurationModel model ) { switch( tuner.getTunerType() ) { diff --git a/src/source/tuner/configuration/TunerConfigurationModel.java b/src/main/java/io/github/dsheirer/source/tuner/configuration/TunerConfigurationModel.java similarity index 92% rename from src/source/tuner/configuration/TunerConfigurationModel.java rename to src/main/java/io/github/dsheirer/source/tuner/configuration/TunerConfigurationModel.java index 40b69708..d29626c1 100644 --- a/src/source/tuner/configuration/TunerConfigurationModel.java +++ b/src/main/java/io/github/dsheirer/source/tuner/configuration/TunerConfigurationModel.java @@ -16,20 +16,17 @@ * along with this program. If not, see ******************************************************************************/ -package source.tuner.configuration; - -import java.util.ArrayList; -import java.util.List; - -import javax.swing.table.AbstractTableModel; +package io.github.dsheirer.source.tuner.configuration; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.source.tuner.Tuner; +import io.github.dsheirer.source.tuner.TunerType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; -import source.tuner.Tuner; -import source.tuner.TunerType; -import source.tuner.configuration.TunerConfigurationEvent.Event; +import javax.swing.table.AbstractTableModel; +import java.util.ArrayList; +import java.util.List; public class TunerConfigurationModel extends AbstractTableModel { @@ -89,7 +86,7 @@ public class TunerConfigurationModel extends AbstractTableModel fireTableRowsInserted( index, index ); - broadcast( new TunerConfigurationEvent( config, Event.ADD ) ); + broadcast( new TunerConfigurationEvent( config, TunerConfigurationEvent.Event.ADD ) ); } } @@ -107,7 +104,7 @@ public class TunerConfigurationModel extends AbstractTableModel fireTableRowsDeleted( index, index ); - broadcast( new TunerConfigurationEvent( config, Event.REMOVE ) ); + broadcast( new TunerConfigurationEvent( config, TunerConfigurationEvent.Event.REMOVE ) ); } } @@ -120,7 +117,7 @@ public class TunerConfigurationModel extends AbstractTableModel { for( TunerConfiguration config: mTunerConfigurations ) { - broadcast( new TunerConfigurationEvent( config, Event.REMOVE ) ); + broadcast( new TunerConfigurationEvent( config, TunerConfigurationEvent.Event.REMOVE ) ); } int size = mTunerConfigurations.size(); @@ -176,14 +173,14 @@ public class TunerConfigurationModel extends AbstractTableModel int index = mTunerConfigurations.indexOf( config ); fireTableCellUpdated( index, ASSIGNED ); - broadcast( new TunerConfigurationEvent( config, Event.CHANGE ) ); + broadcast( new TunerConfigurationEvent( config, TunerConfigurationEvent.Event.CHANGE ) ); } } configToAssign.setAssigned( true ); int index = mTunerConfigurations.indexOf( configToAssign ); fireTableCellUpdated( index, ASSIGNED ); - broadcast( new TunerConfigurationEvent( configToAssign, Event.CHANGE ) ); + broadcast( new TunerConfigurationEvent( configToAssign, TunerConfigurationEvent.Event.CHANGE ) ); } } @@ -379,6 +376,6 @@ public class TunerConfigurationModel extends AbstractTableModel assigned.setFrequency( tuner.getTunerController().getFrequency() ); - broadcast( new TunerConfigurationEvent( assigned, Event.CHANGE ) ); + broadcast( new TunerConfigurationEvent( assigned, TunerConfigurationEvent.Event.CHANGE ) ); } } diff --git a/src/source/tuner/ettus/B100Tuner.java b/src/main/java/io/github/dsheirer/source/tuner/ettus/B100Tuner.java similarity index 82% rename from src/source/tuner/ettus/B100Tuner.java rename to src/main/java/io/github/dsheirer/source/tuner/ettus/B100Tuner.java index be5271f8..591b81b2 100644 --- a/src/source/tuner/ettus/B100Tuner.java +++ b/src/main/java/io/github/dsheirer/source/tuner/ettus/B100Tuner.java @@ -15,18 +15,18 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner.ettus; +package io.github.dsheirer.source.tuner.ettus; + +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.tuner.Tuner; +import io.github.dsheirer.source.tuner.TunerChannel; +import io.github.dsheirer.source.tuner.TunerChannelSource; +import io.github.dsheirer.source.tuner.TunerClass; +import io.github.dsheirer.source.tuner.TunerType; +import io.github.dsheirer.source.tuner.usb.USBTunerDevice; import java.util.concurrent.RejectedExecutionException; -import source.SourceException; -import source.tuner.Tuner; -import source.tuner.TunerChannel; -import source.tuner.TunerChannelSource; -import source.tuner.TunerClass; -import source.tuner.TunerType; -import source.tuner.usb.USBTunerDevice; - public class B100Tuner extends Tuner { public B100Tuner( USBTunerDevice device ) diff --git a/src/source/tuner/ettus/B100TunerEditorPanel.java b/src/main/java/io/github/dsheirer/source/tuner/ettus/B100TunerEditorPanel.java similarity index 90% rename from src/source/tuner/ettus/B100TunerEditorPanel.java rename to src/main/java/io/github/dsheirer/source/tuner/ettus/B100TunerEditorPanel.java index ed30ed68..be2238f0 100644 --- a/src/source/tuner/ettus/B100TunerEditorPanel.java +++ b/src/main/java/io/github/dsheirer/source/tuner/ettus/B100TunerEditorPanel.java @@ -15,14 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner.ettus; - -import javax.swing.BorderFactory; -import javax.swing.JLabel; -import javax.swing.JPanel; +package io.github.dsheirer.source.tuner.ettus; +import io.github.dsheirer.settings.SettingsManager; import net.miginfocom.swing.MigLayout; -import settings.SettingsManager; + +import javax.swing.*; public class B100TunerEditorPanel extends JPanel { diff --git a/src/source/tuner/fcd/FCDCommand.java b/src/main/java/io/github/dsheirer/source/tuner/fcd/FCDCommand.java similarity index 99% rename from src/source/tuner/fcd/FCDCommand.java rename to src/main/java/io/github/dsheirer/source/tuner/fcd/FCDCommand.java index 821d933b..fc345726 100644 --- a/src/source/tuner/fcd/FCDCommand.java +++ b/src/main/java/io/github/dsheirer/source/tuner/fcd/FCDCommand.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner.fcd; +package io.github.dsheirer.source.tuner.fcd; public enum FCDCommand { diff --git a/src/source/tuner/fcd/FCDModel.java b/src/main/java/io/github/dsheirer/source/tuner/fcd/FCDModel.java similarity index 97% rename from src/source/tuner/fcd/FCDModel.java rename to src/main/java/io/github/dsheirer/source/tuner/fcd/FCDModel.java index 8c359b71..ab9fda8e 100644 --- a/src/source/tuner/fcd/FCDModel.java +++ b/src/main/java/io/github/dsheirer/source/tuner/fcd/FCDModel.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner.fcd; +package io.github.dsheirer.source.tuner.fcd; public enum FCDModel { diff --git a/src/source/tuner/fcd/FCDTuner.java b/src/main/java/io/github/dsheirer/source/tuner/fcd/FCDTuner.java similarity index 81% rename from src/source/tuner/fcd/FCDTuner.java rename to src/main/java/io/github/dsheirer/source/tuner/fcd/FCDTuner.java index 9c32abfd..7425a6d2 100644 --- a/src/source/tuner/fcd/FCDTuner.java +++ b/src/main/java/io/github/dsheirer/source/tuner/fcd/FCDTuner.java @@ -15,22 +15,22 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner.fcd; +package io.github.dsheirer.source.tuner.fcd; + +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.adapter.ShortAdapter; +import io.github.dsheirer.sample.complex.ComplexBuffer; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.tuner.MixerTuner; +import io.github.dsheirer.source.tuner.MixerTunerDataLine; +import io.github.dsheirer.source.tuner.TunerChannel; +import io.github.dsheirer.source.tuner.TunerChannelSource; +import io.github.dsheirer.source.tuner.TunerClass; +import io.github.dsheirer.source.tuner.TunerEvent; +import io.github.dsheirer.source.tuner.TunerType; import java.util.concurrent.RejectedExecutionException; -import sample.Listener; -import sample.adapter.ShortAdapter; -import sample.complex.ComplexBuffer; -import source.SourceException; -import source.tuner.MixerTuner; -import source.tuner.MixerTunerDataLine; -import source.tuner.TunerChannel; -import source.tuner.TunerChannelSource; -import source.tuner.TunerClass; -import source.tuner.TunerEvent; -import source.tuner.TunerType; - public class FCDTuner extends MixerTuner { public FCDTuner( MixerTunerDataLine mixerTDL, diff --git a/src/source/tuner/fcd/FCDTunerController.java b/src/main/java/io/github/dsheirer/source/tuner/fcd/FCDTunerController.java similarity index 96% rename from src/source/tuner/fcd/FCDTunerController.java rename to src/main/java/io/github/dsheirer/source/tuner/fcd/FCDTunerController.java index f8dae0e8..842335b6 100644 --- a/src/source/tuner/fcd/FCDTunerController.java +++ b/src/main/java/io/github/dsheirer/source/tuner/fcd/FCDTunerController.java @@ -16,8 +16,14 @@ * along with this program. If not, see * ******************************************************************************/ -package source.tuner.fcd; +package io.github.dsheirer.source.tuner.fcd; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.tuner.TunerClass; +import io.github.dsheirer.source.tuner.TunerController; +import io.github.dsheirer.source.tuner.TunerType; +import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; +import io.github.dsheirer.source.tuner.fcd.proV1.FCD1TunerController; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.usb4java.Device; @@ -25,12 +31,6 @@ import org.usb4java.DeviceDescriptor; import org.usb4java.DeviceHandle; import org.usb4java.LibUsb; import org.usb4java.LibUsbException; -import source.SourceException; -import source.tuner.TunerClass; -import source.tuner.TunerController; -import source.tuner.TunerType; -import source.tuner.configuration.TunerConfiguration; -import source.tuner.fcd.proV1.FCD1TunerController.Block; import javax.usb.UsbClaimException; import javax.usb.UsbException; @@ -538,14 +538,14 @@ public abstract class FCDTunerController extends TunerController return retVal; } - public Block getBandBlocking() + public FCD1TunerController.Block getBandBlocking() { - Block retVal = Block.UNKNOWN; + FCD1TunerController.Block retVal = FCD1TunerController.Block.UNKNOWN; switch(mMode) { case APPLICATION: - retVal = Block.getBlock(mConfig.substring(23, 33).trim()); + retVal = FCD1TunerController.Block.getBlock(mConfig.substring(23, 33).trim()); break; case BOOTLOADER: case UNKNOWN: diff --git a/src/main/java/io/github/dsheirer/source/tuner/fcd/proV1/FCD1TunerConfiguration.java b/src/main/java/io/github/dsheirer/source/tuner/fcd/proV1/FCD1TunerConfiguration.java new file mode 100644 index 00000000..79e9a1a4 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/fcd/proV1/FCD1TunerConfiguration.java @@ -0,0 +1,145 @@ +/******************************************************************************* + * 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 + ******************************************************************************/ +package io.github.dsheirer.source.tuner.fcd.proV1; + +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.github.dsheirer.source.tuner.TunerType; +import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; +import io.github.dsheirer.source.tuner.fcd.proV1.FCD1TunerController.LNAEnhance; +import io.github.dsheirer.source.tuner.fcd.proV1.FCD1TunerController.LNAGain; +import io.github.dsheirer.source.tuner.fcd.proV1.FCD1TunerController.MixerGain; + +public class FCD1TunerConfiguration extends TunerConfiguration +{ + private double mFrequencyCorrection = 22.0d; + private double mInphaseDCCorrection = 0.0d; + private double mQuadratureDCCorrection = 0.0d; + private double mPhaseCorrection = 0.0d; + private double mGainCorrection = 0.0d; + + private LNAGain mLNAGain = LNAGain.LNA_GAIN_PLUS_20_0; + private LNAEnhance mLNAEnhance = LNAEnhance.LNA_ENHANCE_OFF; + private MixerGain mMixerGain = MixerGain.MIXER_GAIN_PLUS_12_0; + + /** + * Default constructor for JAXB + */ + public FCD1TunerConfiguration() + { + } + + public FCD1TunerConfiguration(String uniqueID, String name) + { + super(uniqueID, name); + } + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + @Override + public TunerType getTunerType() + { + return TunerType.FUNCUBE_DONGLE_PRO; + } + + @JacksonXmlProperty(isAttribute = true, localName = "lna_gain") + public LNAGain getLNAGain() + { + return mLNAGain; + } + + public void setLNAGain(LNAGain gain) + { + mLNAGain = gain; + } + + public LNAEnhance getLNAEnhance() + { + return mLNAEnhance; + } + + @JacksonXmlProperty(isAttribute = true, localName = "lna_enhance") + public void setLNAEnhance(LNAEnhance enhance) + { + mLNAEnhance = enhance; + } + + @JacksonXmlProperty(isAttribute = true, localName = "mixer_gain") + public MixerGain getMixerGain() + { + return mMixerGain; + } + + public void setMixerGain(MixerGain gain) + { + mMixerGain = gain; + } + + @JacksonXmlProperty(isAttribute = true, localName = "frequency_correction") + public double getFrequencyCorrection() + { + return mFrequencyCorrection; + } + + public void setFrequencyCorrection(double value) + { + mFrequencyCorrection = value; + } + + @JacksonXmlProperty(isAttribute = true, localName = "inphase_dc_correction") + public double getInphaseDCCorrection() + { + return mInphaseDCCorrection; + } + + public void setInphaseDCCorrection(double value) + { + mInphaseDCCorrection = value; + } + + @JacksonXmlProperty(isAttribute = true, localName = "quadrature_dc_correction") + public double getQuadratureDCCorrection() + { + return mQuadratureDCCorrection; + } + + public void setQuadratureDCCorrection(double value) + { + mQuadratureDCCorrection = value; + } + + @JacksonXmlProperty(isAttribute = true, localName = "phase_correction") + public double getPhaseCorrection() + { + return mPhaseCorrection; + } + + public void setPhaseCorrection(double value) + { + mPhaseCorrection = value; + } + + @JacksonXmlProperty(isAttribute = true, localName = "gain_correction") + public double getGainCorrection() + { + return mGainCorrection; + } + + public void setGainCorrection(double value) + { + mGainCorrection = value; + } +} diff --git a/src/source/tuner/fcd/proV1/FCD1TunerController.java b/src/main/java/io/github/dsheirer/source/tuner/fcd/proV1/FCD1TunerController.java similarity index 97% rename from src/source/tuner/fcd/proV1/FCD1TunerController.java rename to src/main/java/io/github/dsheirer/source/tuner/fcd/proV1/FCD1TunerController.java index 9df0590e..946c8d43 100644 --- a/src/source/tuner/fcd/proV1/FCD1TunerController.java +++ b/src/main/java/io/github/dsheirer/source/tuner/fcd/proV1/FCD1TunerController.java @@ -15,26 +15,24 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner.fcd.proV1; - -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -import javax.usb.UsbClaimException; -import javax.usb.UsbException; +package io.github.dsheirer.source.tuner.fcd.proV1; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.tuner.MixerTunerType; +import io.github.dsheirer.source.tuner.TunerClass; +import io.github.dsheirer.source.tuner.TunerType; +import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; +import io.github.dsheirer.source.tuner.fcd.FCDCommand; +import io.github.dsheirer.source.tuner.fcd.FCDTunerController; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.usb4java.Device; import org.usb4java.DeviceDescriptor; -import source.SourceException; -import source.tuner.MixerTunerType; -import source.tuner.TunerClass; -import source.tuner.TunerType; -import source.tuner.configuration.TunerConfiguration; -import source.tuner.fcd.FCDCommand; -import source.tuner.fcd.FCDTunerController; +import javax.usb.UsbClaimException; +import javax.usb.UsbException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; public class FCD1TunerController extends FCDTunerController { @@ -251,7 +249,7 @@ public class FCD1TunerController extends FCDTunerController * The interface expects an argument with the SIGNED phase value in the first * 16 bits and the UNSIGNED gain value in the second 16 bits, both in * big-endian format. Since we're sending the argument in java little endian - * format, we place the phase in the high-order bits and the gain in the + * format, we place the phase in the high-order bits and the gain in the * low-order bits, so that the send(command) function will reorder the bytes * into big endian format, and place the arguments correctly. * @@ -299,7 +297,7 @@ public class FCD1TunerController extends FCDTunerController int correction = buffer.getInt( 2 ); /** - * Gain: mask the upper 16 phase bits and right shift to get the + * Gain: mask the upper 16 phase bits and right shift to get the * unsigned short value and then divide by 32768 to get the double * value. We place the unsigned short value in an int to avoid sign * issues. @@ -379,12 +377,12 @@ public class FCD1TunerController extends FCDTunerController * Sends the I/Q DC offset correction values to FCD. * * The interface expects an argument with the signed inphase value in the - * first 16 bits and the signed quadrature value in the second 16 bits, + * first 16 bits and the signed quadrature value in the second 16 bits, * both in big-endian format. * * Since we're sending the argument in java little endian format, we place - * the quadrature in the high-order bits and the inphase in the low-order - * bits, so that the send(command) function will reorder the bytes into big + * the quadrature in the high-order bits and the inphase in the low-order + * bits, so that the send(command) function will reorder the bytes into big * endian format, and place the arguments correctly. * * Both Inphase and Quadrature correction values range -1.0 to 0.0 to 1.0 @@ -438,7 +436,7 @@ public class FCD1TunerController extends FCDTunerController mDCCorrectionQuadrature = ( (short)quadrature / (double)Short.MAX_VALUE ); /** - * InPhase: mask the lower 16 bits to get the short + * InPhase: mask the lower 16 bits to get the short * value and then divide by 32768 to get the stored inphase value. * Cast the 16-bit value to a short to get the signed short value */ diff --git a/src/source/tuner/fcd/proV1/FCD1TunerEditor.java b/src/main/java/io/github/dsheirer/source/tuner/fcd/proV1/FCD1TunerEditor.java similarity index 89% rename from src/source/tuner/fcd/proV1/FCD1TunerEditor.java rename to src/main/java/io/github/dsheirer/source/tuner/fcd/proV1/FCD1TunerEditor.java index 5c8f834b..1c785f29 100644 --- a/src/source/tuner/fcd/proV1/FCD1TunerEditor.java +++ b/src/main/java/io/github/dsheirer/source/tuner/fcd/proV1/FCD1TunerEditor.java @@ -15,43 +15,27 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner.fcd.proV1; +package io.github.dsheirer.source.tuner.fcd.proV1; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; +import io.github.dsheirer.source.tuner.configuration.TunerConfigurationEditor; +import io.github.dsheirer.source.tuner.configuration.TunerConfigurationEvent; +import io.github.dsheirer.source.tuner.configuration.TunerConfigurationModel; +import io.github.dsheirer.source.tuner.fcd.FCDTuner; +import net.miginfocom.swing.MigLayout; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.text.DecimalFormat; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JSeparator; -import javax.swing.JSpinner; -import javax.swing.JTextField; -import javax.swing.SpinnerModel; -import javax.swing.SpinnerNumberModel; -import javax.swing.SwingConstants; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - -import net.miginfocom.swing.MigLayout; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import source.SourceException; -import source.tuner.configuration.TunerConfiguration; -import source.tuner.configuration.TunerConfigurationEditor; -import source.tuner.configuration.TunerConfigurationEvent; -import source.tuner.configuration.TunerConfigurationEvent.Event; -import source.tuner.configuration.TunerConfigurationModel; -import source.tuner.fcd.FCDTuner; -import source.tuner.fcd.proV1.FCD1TunerController.LNAEnhance; -import source.tuner.fcd.proV1.FCD1TunerController.LNAGain; -import source.tuner.fcd.proV1.FCD1TunerController.MixerGain; - public class FCD1TunerEditor extends TunerConfigurationEditor { private static final long serialVersionUID = 1L; @@ -60,9 +44,9 @@ public class FCD1TunerEditor extends TunerConfigurationEditor private JTextField mConfigurationName; private JButton mTunerInfo; private JSpinner mFrequencyCorrection; - private JComboBox mComboLNAGain; - private JComboBox mComboLNAEnhance; - private JComboBox mComboMixerGain; + private JComboBox mComboLNAGain; + private JComboBox mComboLNAEnhance; + private JComboBox mComboMixerGain; private CorrectionSpinner mCorrectionDCI; private CorrectionSpinner mCorrectionDCQ; private CorrectionSpinner mCorrectionGain; @@ -71,7 +55,7 @@ public class FCD1TunerEditor extends TunerConfigurationEditor private FCD1TunerController mController; - public FCD1TunerEditor( TunerConfigurationModel tunerConfigurationModel, FCDTuner tuner ) + public FCD1TunerEditor(TunerConfigurationModel tunerConfigurationModel, FCDTuner tuner ) { super( tunerConfigurationModel ); mController = (FCD1TunerController)tuner.getController(); @@ -170,7 +154,7 @@ public class FCD1TunerEditor extends TunerConfigurationEditor add( new JSeparator( JSeparator.HORIZONTAL ), "span,grow" ); add( new JLabel( "Gain" ), "span,align center" ); - mComboLNAGain = new JComboBox( LNAGain.values() ); + mComboLNAGain = new JComboBox( FCD1TunerController.LNAGain.values() ); mComboLNAGain.setEnabled( false ); mComboLNAGain.setToolTipText( "Adjust the low noise amplifier gain setting." ); mComboLNAGain.addActionListener( new ActionListener() @@ -178,7 +162,7 @@ public class FCD1TunerEditor extends TunerConfigurationEditor @Override public void actionPerformed( ActionEvent arg0 ) { - LNAGain gain = (LNAGain)mComboLNAGain.getSelectedItem(); + FCD1TunerController.LNAGain gain = (FCD1TunerController.LNAGain)mComboLNAGain.getSelectedItem(); try @@ -202,7 +186,7 @@ public class FCD1TunerEditor extends TunerConfigurationEditor /** * LNA Enhance */ - mComboLNAEnhance = new JComboBox( LNAEnhance.values() ); + mComboLNAEnhance = new JComboBox( FCD1TunerController.LNAEnhance.values() ); mComboLNAEnhance.setToolTipText( "Adjust the LNA enhance setting. Default value is OFF" ); mComboLNAEnhance.addActionListener( new ActionListener() @@ -210,7 +194,7 @@ public class FCD1TunerEditor extends TunerConfigurationEditor @Override public void actionPerformed( ActionEvent arg0 ) { - LNAEnhance enhance = (LNAEnhance)mComboLNAEnhance.getSelectedItem(); + FCD1TunerController.LNAEnhance enhance = (FCD1TunerController.LNAEnhance)mComboLNAEnhance.getSelectedItem(); try { @@ -233,7 +217,7 @@ public class FCD1TunerEditor extends TunerConfigurationEditor /** * Mixer Gain */ - mComboMixerGain = new JComboBox( MixerGain.values() ); + mComboMixerGain = new JComboBox( FCD1TunerController.MixerGain.values() ); mComboMixerGain.setToolTipText( "Adjust mixer gain setting" ); @@ -242,7 +226,7 @@ public class FCD1TunerEditor extends TunerConfigurationEditor @Override public void actionPerformed( ActionEvent arg0 ) { - MixerGain gain = (MixerGain)mComboMixerGain.getSelectedItem(); + FCD1TunerController.MixerGain gain = (FCD1TunerController.MixerGain)mComboMixerGain.getSelectedItem(); try { @@ -400,9 +384,9 @@ public class FCD1TunerEditor extends TunerConfigurationEditor double value = ((SpinnerNumberModel)mFrequencyCorrection .getModel()).getNumber().doubleValue(); config.setFrequencyCorrection( value ); - config.setLNAEnhance( (LNAEnhance)mComboLNAEnhance.getSelectedItem() ); - config.setLNAGain( (LNAGain)mComboLNAGain.getSelectedItem() ); - config.setMixerGain( (MixerGain)mComboMixerGain.getSelectedItem() ); + config.setLNAEnhance( (FCD1TunerController.LNAEnhance)mComboLNAEnhance.getSelectedItem() ); + config.setLNAGain( (FCD1TunerController.LNAGain)mComboLNAGain.getSelectedItem() ); + config.setMixerGain( (FCD1TunerController.MixerGain)mComboMixerGain.getSelectedItem() ); double dci = ((SpinnerNumberModel)mCorrectionDCI.getModel()).getNumber().doubleValue(); config.setInphaseDCCorrection( dci ); @@ -416,7 +400,7 @@ public class FCD1TunerEditor extends TunerConfigurationEditor double phase = ((SpinnerNumberModel)mCorrectionPhase.getModel()).getNumber().doubleValue(); config.setPhaseCorrection( phase ); - getTunerConfigurationModel().broadcast( new TunerConfigurationEvent( getConfiguration(), Event.CHANGE ) ); + getTunerConfigurationModel().broadcast( new TunerConfigurationEvent( getConfiguration(), TunerConfigurationEvent.Event.CHANGE ) ); } } diff --git a/src/main/java/io/github/dsheirer/source/tuner/fcd/proplusV2/FCD2TunerConfiguration.java b/src/main/java/io/github/dsheirer/source/tuner/fcd/proplusV2/FCD2TunerConfiguration.java new file mode 100644 index 00000000..6d11d176 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/fcd/proplusV2/FCD2TunerConfiguration.java @@ -0,0 +1,81 @@ +/******************************************************************************* + * 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 + ******************************************************************************/ +package io.github.dsheirer.source.tuner.fcd.proplusV2; + +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.github.dsheirer.source.tuner.TunerType; +import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; + +public class FCD2TunerConfiguration extends TunerConfiguration +{ + private boolean mGainLNA = true; + private boolean mGainMixer = true; + private double mFrequencyCorrection = -2.2d; + + /** + * Default constructor for JAXB + */ + public FCD2TunerConfiguration() + { + } + + public FCD2TunerConfiguration(String uniqueID, String name) + { + super(uniqueID, name); + } + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + @Override + public TunerType getTunerType() + { + return TunerType.FUNCUBE_DONGLE_PRO_PLUS; + } + + @JacksonXmlProperty(isAttribute = true, localName = "lna_gain") + public boolean getGainLNA() + { + return mGainLNA; + } + + public void setGainLNA(boolean gain) + { + mGainLNA = gain; + } + + @JacksonXmlProperty(isAttribute = true, localName = "mixer_gain") + public boolean getGainMixer() + { + return mGainMixer; + } + + public void setGainMixer(boolean gain) + { + mGainMixer = gain; + } + + @JacksonXmlProperty(isAttribute = true, localName = "frequency_correction") + public double getFrequencyCorrection() + { + return mFrequencyCorrection; + } + + public void setFrequencyCorrection(double value) + { + mFrequencyCorrection = value; + } +} diff --git a/src/source/tuner/fcd/proplusV2/FCD2TunerController.java b/src/main/java/io/github/dsheirer/source/tuner/fcd/proplusV2/FCD2TunerController.java similarity index 92% rename from src/source/tuner/fcd/proplusV2/FCD2TunerController.java rename to src/main/java/io/github/dsheirer/source/tuner/fcd/proplusV2/FCD2TunerController.java index f2173ceb..5efbc669 100644 --- a/src/source/tuner/fcd/proplusV2/FCD2TunerController.java +++ b/src/main/java/io/github/dsheirer/source/tuner/fcd/proplusV2/FCD2TunerController.java @@ -16,19 +16,19 @@ * along with this program. If not, see * ******************************************************************************/ -package source.tuner.fcd.proplusV2; +package io.github.dsheirer.source.tuner.fcd.proplusV2; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.tuner.MixerTunerType; +import io.github.dsheirer.source.tuner.TunerClass; +import io.github.dsheirer.source.tuner.TunerType; +import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; +import io.github.dsheirer.source.tuner.fcd.FCDCommand; +import io.github.dsheirer.source.tuner.fcd.FCDTunerController; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.usb4java.Device; import org.usb4java.DeviceDescriptor; -import source.SourceException; -import source.tuner.MixerTunerType; -import source.tuner.TunerClass; -import source.tuner.TunerType; -import source.tuner.configuration.TunerConfiguration; -import source.tuner.fcd.FCDCommand; -import source.tuner.fcd.FCDTunerController; import java.nio.ByteBuffer; import java.nio.ByteOrder; diff --git a/src/source/tuner/fcd/proplusV2/FCD2TunerEditor.java b/src/main/java/io/github/dsheirer/source/tuner/fcd/proplusV2/FCD2TunerEditor.java similarity index 92% rename from src/source/tuner/fcd/proplusV2/FCD2TunerEditor.java rename to src/main/java/io/github/dsheirer/source/tuner/fcd/proplusV2/FCD2TunerEditor.java index 1e0ab570..97db4f17 100644 --- a/src/source/tuner/fcd/proplusV2/FCD2TunerEditor.java +++ b/src/main/java/io/github/dsheirer/source/tuner/fcd/proplusV2/FCD2TunerEditor.java @@ -15,40 +15,28 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner.fcd.proplusV2; +package io.github.dsheirer.source.tuner.fcd.proplusV2; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; +import io.github.dsheirer.source.tuner.configuration.TunerConfigurationEditor; +import io.github.dsheirer.source.tuner.configuration.TunerConfigurationEvent; +import io.github.dsheirer.source.tuner.configuration.TunerConfigurationEvent.Event; +import io.github.dsheirer.source.tuner.configuration.TunerConfigurationModel; +import io.github.dsheirer.source.tuner.fcd.FCDTuner; +import net.miginfocom.swing.MigLayout; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.text.DecimalFormat; -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JSeparator; -import javax.swing.JSpinner; -import javax.swing.JTextField; -import javax.swing.SpinnerModel; -import javax.swing.SpinnerNumberModel; -import javax.swing.SwingConstants; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - -import net.miginfocom.swing.MigLayout; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import source.SourceException; -import source.tuner.configuration.TunerConfiguration; -import source.tuner.configuration.TunerConfigurationEditor; -import source.tuner.configuration.TunerConfigurationEvent; -import source.tuner.configuration.TunerConfigurationEvent.Event; -import source.tuner.configuration.TunerConfigurationModel; -import source.tuner.fcd.FCDTuner; - public class FCD2TunerEditor extends TunerConfigurationEditor { private final static Logger mLog = LoggerFactory.getLogger( FCD2TunerEditor.class ); diff --git a/src/source/tuner/frequency/DCTrackingFrequencyControl.java b/src/main/java/io/github/dsheirer/source/tuner/frequency/DCTrackingFrequencyControl.java similarity index 92% rename from src/source/tuner/frequency/DCTrackingFrequencyControl.java rename to src/main/java/io/github/dsheirer/source/tuner/frequency/DCTrackingFrequencyControl.java index 7cfe5648..74c5367f 100644 --- a/src/source/tuner/frequency/DCTrackingFrequencyControl.java +++ b/src/main/java/io/github/dsheirer/source/tuner/frequency/DCTrackingFrequencyControl.java @@ -1,4 +1,4 @@ -package source.tuner.frequency; +package io.github.dsheirer.source.tuner.frequency; /******************************************************************************* * SDR Trunk * Copyright (C) 2016 Dennis Sheirer @@ -16,12 +16,13 @@ package source.tuner.frequency; * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -import java.util.concurrent.ScheduledExecutorService; -import module.Module; -import sample.Listener; -import sample.real.RealBuffer; -import source.tuner.frequency.FrequencyChangeEvent.Event; +import io.github.dsheirer.module.Module; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.RealBuffer; +import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent.Event; + +import java.util.concurrent.ScheduledExecutorService; public class DCTrackingFrequencyControl extends Module implements Listener, IFrequencyChangeProvider @@ -36,7 +37,7 @@ public class DCTrackingFrequencyControl extends Module /** * DC offset Automatic Frequency Control. Monitors DC bias present in an FM - * demodulated audio stream and issues automatic frequency corrections to + * demodulated audio stream and issues automatic frequency corrections to * maintain the DC bias close to zero. * * @param maximum - maximum allowable (+/-) frequency correction value. diff --git a/src/source/tuner/frequency/FrequencyChangeEvent.java b/src/main/java/io/github/dsheirer/source/tuner/frequency/FrequencyChangeEvent.java similarity index 91% rename from src/source/tuner/frequency/FrequencyChangeEvent.java rename to src/main/java/io/github/dsheirer/source/tuner/frequency/FrequencyChangeEvent.java index 9ceb3685..f0a9b94f 100644 --- a/src/source/tuner/frequency/FrequencyChangeEvent.java +++ b/src/main/java/io/github/dsheirer/source/tuner/frequency/FrequencyChangeEvent.java @@ -1,4 +1,4 @@ -package source.tuner.frequency; +package io.github.dsheirer.source.tuner.frequency; public class FrequencyChangeEvent { diff --git a/src/source/tuner/frequency/FrequencyChangeProcessorWrapper.java b/src/main/java/io/github/dsheirer/source/tuner/frequency/FrequencyChangeProcessorWrapper.java similarity index 86% rename from src/source/tuner/frequency/FrequencyChangeProcessorWrapper.java rename to src/main/java/io/github/dsheirer/source/tuner/frequency/FrequencyChangeProcessorWrapper.java index 8aa66445..4f1baec0 100644 --- a/src/source/tuner/frequency/FrequencyChangeProcessorWrapper.java +++ b/src/main/java/io/github/dsheirer/source/tuner/frequency/FrequencyChangeProcessorWrapper.java @@ -1,10 +1,9 @@ -package source.tuner.frequency; +package io.github.dsheirer.source.tuner.frequency; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.source.SourceException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; -import source.SourceException; -import source.tuner.hackrf.HackRFTunerEditor; public class FrequencyChangeProcessorWrapper implements IFrequencyChangeListener, Listener diff --git a/src/source/tuner/frequency/FrequencyController.java b/src/main/java/io/github/dsheirer/source/tuner/frequency/FrequencyController.java similarity index 96% rename from src/source/tuner/frequency/FrequencyController.java rename to src/main/java/io/github/dsheirer/source/tuner/frequency/FrequencyController.java index 7262317b..217afa00 100644 --- a/src/source/tuner/frequency/FrequencyController.java +++ b/src/main/java/io/github/dsheirer/source/tuner/frequency/FrequencyController.java @@ -15,17 +15,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner.frequency; - -import java.util.ArrayList; +package io.github.dsheirer.source.tuner.frequency; +import io.github.dsheirer.source.InvalidFrequencyException; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent.Event; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import source.InvalidFrequencyException; -import source.Source; -import source.SourceException; -import source.tuner.frequency.FrequencyChangeEvent.Event; +import java.util.ArrayList; public class FrequencyController { diff --git a/src/source/tuner/frequency/FrequencyLimitException.java b/src/main/java/io/github/dsheirer/source/tuner/frequency/FrequencyLimitException.java similarity index 94% rename from src/source/tuner/frequency/FrequencyLimitException.java rename to src/main/java/io/github/dsheirer/source/tuner/frequency/FrequencyLimitException.java index be72a74e..566dc992 100644 --- a/src/source/tuner/frequency/FrequencyLimitException.java +++ b/src/main/java/io/github/dsheirer/source/tuner/frequency/FrequencyLimitException.java @@ -1,4 +1,4 @@ -package source.tuner.frequency; +package io.github.dsheirer.source.tuner.frequency; public class FrequencyLimitException extends Exception { diff --git a/src/source/tuner/frequency/IFrequencyChangeListener.java b/src/main/java/io/github/dsheirer/source/tuner/frequency/IFrequencyChangeListener.java similarity index 93% rename from src/source/tuner/frequency/IFrequencyChangeListener.java rename to src/main/java/io/github/dsheirer/source/tuner/frequency/IFrequencyChangeListener.java index 99b75804..eda2e784 100644 --- a/src/source/tuner/frequency/IFrequencyChangeListener.java +++ b/src/main/java/io/github/dsheirer/source/tuner/frequency/IFrequencyChangeListener.java @@ -15,9 +15,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner.frequency; +package io.github.dsheirer.source.tuner.frequency; -import sample.Listener; +import io.github.dsheirer.sample.Listener; /** diff --git a/src/source/tuner/frequency/IFrequencyChangeProcessor.java b/src/main/java/io/github/dsheirer/source/tuner/frequency/IFrequencyChangeProcessor.java similarity index 56% rename from src/source/tuner/frequency/IFrequencyChangeProcessor.java rename to src/main/java/io/github/dsheirer/source/tuner/frequency/IFrequencyChangeProcessor.java index 788c46ac..b47c47f6 100644 --- a/src/source/tuner/frequency/IFrequencyChangeProcessor.java +++ b/src/main/java/io/github/dsheirer/source/tuner/frequency/IFrequencyChangeProcessor.java @@ -1,6 +1,6 @@ -package source.tuner.frequency; +package io.github.dsheirer.source.tuner.frequency; -import source.SourceException; +import io.github.dsheirer.source.SourceException; public interface IFrequencyChangeProcessor { diff --git a/src/source/tuner/frequency/IFrequencyChangeProvider.java b/src/main/java/io/github/dsheirer/source/tuner/frequency/IFrequencyChangeProvider.java similarity index 91% rename from src/source/tuner/frequency/IFrequencyChangeProvider.java rename to src/main/java/io/github/dsheirer/source/tuner/frequency/IFrequencyChangeProvider.java index 354e9af9..f3dcb6fd 100644 --- a/src/source/tuner/frequency/IFrequencyChangeProvider.java +++ b/src/main/java/io/github/dsheirer/source/tuner/frequency/IFrequencyChangeProvider.java @@ -16,9 +16,9 @@ * along with this program. If not, see * ******************************************************************************/ -package source.tuner.frequency; +package io.github.dsheirer.source.tuner.frequency; -import sample.Listener; +import io.github.dsheirer.sample.Listener; /** * Provider of Frequency Change Events diff --git a/src/source/tuner/hackrf/HackRFTuner.java b/src/main/java/io/github/dsheirer/source/tuner/hackrf/HackRFTuner.java similarity index 81% rename from src/source/tuner/hackrf/HackRFTuner.java rename to src/main/java/io/github/dsheirer/source/tuner/hackrf/HackRFTuner.java index 2194a7de..ce79bdb7 100644 --- a/src/source/tuner/hackrf/HackRFTuner.java +++ b/src/main/java/io/github/dsheirer/source/tuner/hackrf/HackRFTuner.java @@ -15,23 +15,21 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner.hackrf; - -import java.util.concurrent.RejectedExecutionException; +package io.github.dsheirer.source.tuner.hackrf; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.ComplexBuffer; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.tuner.Tuner; +import io.github.dsheirer.source.tuner.TunerChannel; +import io.github.dsheirer.source.tuner.TunerChannelSource; +import io.github.dsheirer.source.tuner.TunerClass; +import io.github.dsheirer.source.tuner.TunerEvent; +import io.github.dsheirer.source.tuner.TunerType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.Listener; -import sample.complex.ComplexBuffer; -import source.SourceException; -import source.tuner.Tuner; -import source.tuner.TunerChannel; -import source.tuner.TunerChannelSource; -import source.tuner.TunerClass; -import source.tuner.TunerEvent; -import source.tuner.TunerType; -import source.tuner.hackrf.HackRFTunerController.BoardID; +import java.util.concurrent.RejectedExecutionException; public class HackRFTuner extends Tuner { @@ -71,7 +69,7 @@ public class HackRFTuner extends Tuner } @Override - public TunerChannelSource getChannel( TunerChannel channel ) + public TunerChannelSource getChannel(TunerChannel channel ) throws RejectedExecutionException, SourceException { TunerChannelSource source = getController().getChannel( this, channel ); @@ -109,7 +107,7 @@ public class HackRFTuner extends Tuner mLog.error( "error gettting serial number", e ); } - return BoardID.HACKRF_ONE.getLabel(); + return HackRFTunerController.BoardID.HACKRF_ONE.getLabel(); } @Override diff --git a/src/main/java/io/github/dsheirer/source/tuner/hackrf/HackRFTunerConfiguration.java b/src/main/java/io/github/dsheirer/source/tuner/hackrf/HackRFTunerConfiguration.java new file mode 100644 index 00000000..74590f07 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/hackrf/HackRFTunerConfiguration.java @@ -0,0 +1,109 @@ +/******************************************************************************* + * 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 + ******************************************************************************/ +package io.github.dsheirer.source.tuner.hackrf; + + +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.github.dsheirer.source.tuner.TunerType; +import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; +import io.github.dsheirer.source.tuner.hackrf.HackRFTunerController.HackRFLNAGain; +import io.github.dsheirer.source.tuner.hackrf.HackRFTunerController.HackRFSampleRate; +import io.github.dsheirer.source.tuner.hackrf.HackRFTunerController.HackRFVGAGain; + +public class HackRFTunerConfiguration extends TunerConfiguration +{ + private HackRFSampleRate mSampleRate = HackRFSampleRate.RATE2_016MHZ; + private HackRFLNAGain mLNAGain = HackRFLNAGain.GAIN_16; + private HackRFVGAGain mVGAGain = HackRFVGAGain.GAIN_10; + private boolean mAmplifierEnabled = true; + private double mFrequencyCorrection = 0.0d; + + /** + * Default constructor for JAXB + */ + public HackRFTunerConfiguration() + { + } + + public HackRFTunerConfiguration(String uniqueID, String name) + { + super(uniqueID, name); + } + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + @Override + public TunerType getTunerType() + { + return TunerType.HACKRF; + } + + @JacksonXmlProperty(isAttribute = true, localName = "amplifier_enabled") + public boolean getAmplifierEnabled() + { + return mAmplifierEnabled; + } + + public void setAmplifierEnabled(boolean enabled) + { + mAmplifierEnabled = enabled; + } + + @JacksonXmlProperty(isAttribute = true, localName = "lna_gain") + public HackRFLNAGain getLNAGain() + { + return mLNAGain; + } + + public void setLNAGain(HackRFLNAGain lnaGain) + { + mLNAGain = lnaGain; + } + + @JacksonXmlProperty(isAttribute = true, localName = "vga_gain") + public HackRFVGAGain getVGAGain() + { + return mVGAGain; + } + + public void setVGAGain(HackRFVGAGain vgaGain) + { + mVGAGain = vgaGain; + } + + @JacksonXmlProperty(isAttribute = true, localName = "frequency_correction") + public double getFrequencyCorrection() + { + return mFrequencyCorrection; + } + + public void setFrequencyCorrection(double value) + { + mFrequencyCorrection = value; + } + + @JacksonXmlProperty(isAttribute = true, localName = "sample_rate") + public HackRFSampleRate getSampleRate() + { + return mSampleRate; + } + + public void setSampleRate(HackRFSampleRate sampleRate) + { + mSampleRate = sampleRate; + } +} diff --git a/src/source/tuner/hackrf/HackRFTunerController.java b/src/main/java/io/github/dsheirer/source/tuner/hackrf/HackRFTunerController.java similarity index 98% rename from src/source/tuner/hackrf/HackRFTunerController.java rename to src/main/java/io/github/dsheirer/source/tuner/hackrf/HackRFTunerController.java index 1741bfaf..fe232ec4 100644 --- a/src/source/tuner/hackrf/HackRFTunerController.java +++ b/src/main/java/io/github/dsheirer/source/tuner/hackrf/HackRFTunerController.java @@ -11,11 +11,11 @@ * * All rights reserved. * - * Redistribution and use in source and binary forms, with or without + * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * - * Redistributions of source code must retain the above copyright notice, + * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the @@ -51,8 +51,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner.hackrf; +package io.github.dsheirer.source.tuner.hackrf; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.adapter.ByteSampleAdapter; +import io.github.dsheirer.sample.complex.ComplexBuffer; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.tuner.TunerController; +import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; +import io.github.dsheirer.source.tuner.usb.USBTransferProcessor; import org.apache.commons.io.EndianUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -61,20 +68,11 @@ import org.usb4java.DeviceDescriptor; import org.usb4java.DeviceHandle; import org.usb4java.LibUsb; import org.usb4java.LibUsbException; -import sample.Broadcaster; -import sample.Listener; -import sample.adapter.ByteSampleAdapter; -import sample.complex.ComplexBuffer; -import source.SourceException; -import source.tuner.TunerController; -import source.tuner.configuration.TunerConfiguration; -import source.tuner.usb.USBTransferProcessor; import javax.usb.UsbException; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.Arrays; -import java.util.concurrent.LinkedTransferQueue; public class HackRFTunerController extends TunerController { diff --git a/src/source/tuner/hackrf/HackRFTunerEditor.java b/src/main/java/io/github/dsheirer/source/tuner/hackrf/HackRFTunerEditor.java similarity index 83% rename from src/source/tuner/hackrf/HackRFTunerEditor.java rename to src/main/java/io/github/dsheirer/source/tuner/hackrf/HackRFTunerEditor.java index 8962be28..12bb1cf4 100644 --- a/src/source/tuner/hackrf/HackRFTunerEditor.java +++ b/src/main/java/io/github/dsheirer/source/tuner/hackrf/HackRFTunerEditor.java @@ -15,46 +15,27 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner.hackrf; +package io.github.dsheirer.source.tuner.hackrf; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; +import io.github.dsheirer.source.tuner.configuration.TunerConfigurationEditor; +import io.github.dsheirer.source.tuner.configuration.TunerConfigurationEvent; +import io.github.dsheirer.source.tuner.configuration.TunerConfigurationModel; +import net.miginfocom.swing.MigLayout; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import javax.usb.UsbException; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.text.DecimalFormat; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JSeparator; -import javax.swing.JSpinner; -import javax.swing.JTextField; -import javax.swing.JToggleButton; -import javax.swing.SpinnerModel; -import javax.swing.SpinnerNumberModel; -import javax.swing.SwingConstants; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.usb.UsbException; - -import net.miginfocom.swing.MigLayout; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import source.SourceException; -import source.tuner.configuration.TunerConfiguration; -import source.tuner.configuration.TunerConfigurationEditor; -import source.tuner.configuration.TunerConfigurationEvent; -import source.tuner.configuration.TunerConfigurationEvent.Event; -import source.tuner.configuration.TunerConfigurationModel; -import source.tuner.hackrf.HackRFTunerController.BoardID; -import source.tuner.hackrf.HackRFTunerController.HackRFLNAGain; -import source.tuner.hackrf.HackRFTunerController.HackRFSampleRate; -import source.tuner.hackrf.HackRFTunerController.HackRFVGAGain; -import source.tuner.hackrf.HackRFTunerController.Serial; - public class HackRFTunerEditor extends TunerConfigurationEditor { private static final long serialVersionUID = 1L; @@ -63,16 +44,16 @@ public class HackRFTunerEditor extends TunerConfigurationEditor private JTextField mConfigurationName; private JButton mTunerInfo; - private JComboBox mComboSampleRate; + private JComboBox mComboSampleRate; private JSpinner mFrequencyCorrection; private JToggleButton mAmplifier; - private JComboBox mComboLNAGain; - private JComboBox mComboVGAGain; + private JComboBox mComboLNAGain; + private JComboBox mComboVGAGain; private boolean mLoading; private HackRFTunerController mController; - public HackRFTunerEditor( TunerConfigurationModel tunerConfigurationModel, HackRFTuner tuner ) + public HackRFTunerEditor(TunerConfigurationModel tunerConfigurationModel, HackRFTuner tuner ) { super( tunerConfigurationModel ); @@ -127,28 +108,28 @@ public class HackRFTunerEditor extends TunerConfigurationEditor } ); add( mTunerInfo ); - mComboSampleRate = new JComboBox<>( HackRFSampleRate.values() ); + mComboSampleRate = new JComboBox<>( HackRFTunerController.HackRFSampleRate.values() ); mComboSampleRate.setEnabled( false ); mComboSampleRate.addActionListener( new ActionListener() { @Override public void actionPerformed( ActionEvent e ) { - HackRFSampleRate sampleRate = - (HackRFSampleRate)mComboSampleRate.getSelectedItem(); + HackRFTunerController.HackRFSampleRate sampleRate = + (HackRFTunerController.HackRFSampleRate)mComboSampleRate.getSelectedItem(); try { mController.setSampleRate( sampleRate ); save(); } - catch ( SourceException|UsbException e2 ) + catch ( SourceException |UsbException e2 ) { JOptionPane.showMessageDialog( HackRFTunerEditor.this, "HackRF Tuner Controller" - + " - couldn't apply the sample rate setting [" + sampleRate.getLabel() + + + " - couldn't apply the sample rate setting [" + sampleRate.getLabel() + "] " + e2.getLocalizedMessage() ); - mLog.error( "HackRF Tuner Controller - couldn't apply sample rate setting [" + + mLog.error( "HackRF Tuner Controller - couldn't apply sample rate setting [" + sampleRate.getLabel() + "]", e ); } } @@ -224,7 +205,7 @@ public class HackRFTunerEditor extends TunerConfigurationEditor } ); add( mAmplifier ); - mComboLNAGain = new JComboBox( HackRFLNAGain.values() ); + mComboLNAGain = new JComboBox( HackRFTunerController.HackRFLNAGain.values() ); mComboLNAGain.setEnabled( false ); mComboLNAGain.addActionListener( new ActionListener() { @@ -233,11 +214,11 @@ public class HackRFTunerEditor extends TunerConfigurationEditor { try { - HackRFLNAGain lnaGain = (HackRFLNAGain)mComboLNAGain.getSelectedItem(); + HackRFTunerController.HackRFLNAGain lnaGain = (HackRFTunerController.HackRFLNAGain)mComboLNAGain.getSelectedItem(); if ( lnaGain == null ) { - lnaGain = HackRFLNAGain.GAIN_0; + lnaGain = HackRFTunerController.HackRFLNAGain.GAIN_0; } mController.setLNAGain( lnaGain ); @@ -256,7 +237,7 @@ public class HackRFTunerEditor extends TunerConfigurationEditor add( new JLabel( "LNA:" ) ); add( mComboLNAGain ); - mComboVGAGain = new JComboBox( HackRFVGAGain.values() ); + mComboVGAGain = new JComboBox( HackRFTunerController.HackRFVGAGain.values() ); mComboVGAGain.addActionListener( new ActionListener() { @Override @@ -264,11 +245,11 @@ public class HackRFTunerEditor extends TunerConfigurationEditor { try { - HackRFVGAGain vgaGain = (HackRFVGAGain)mComboVGAGain.getSelectedItem(); + HackRFTunerController.HackRFVGAGain vgaGain = (HackRFTunerController.HackRFVGAGain)mComboVGAGain.getSelectedItem(); if( vgaGain == null ) { - vgaGain = HackRFVGAGain.GAIN_4; + vgaGain = HackRFTunerController.HackRFVGAGain.GAIN_4; } mController.setVGAGain( vgaGain ); @@ -331,7 +312,7 @@ public class HackRFTunerEditor extends TunerConfigurationEditor private String getTunerInfo() { - BoardID board = BoardID.INVALID; + HackRFTunerController.BoardID board = HackRFTunerController.BoardID.INVALID; try { @@ -350,7 +331,7 @@ public class HackRFTunerEditor extends TunerConfigurationEditor sb.append( board.getLabel() ); sb.append( "
" ); - Serial serial = null; + HackRFTunerController.Serial serial = null; try { @@ -452,13 +433,13 @@ public class HackRFTunerEditor extends TunerConfigurationEditor double value = ((SpinnerNumberModel)mFrequencyCorrection .getModel()).getNumber().doubleValue(); config.setFrequencyCorrection( value ); - config.setSampleRate( (HackRFSampleRate)mComboSampleRate.getSelectedItem() ); + config.setSampleRate( (HackRFTunerController.HackRFSampleRate)mComboSampleRate.getSelectedItem() ); config.setAmplifierEnabled( mAmplifier.isSelected() ); - config.setLNAGain( (HackRFLNAGain)mComboLNAGain.getSelectedItem() ); - config.setVGAGain( (HackRFVGAGain)mComboVGAGain.getSelectedItem() ); + config.setLNAGain( (HackRFTunerController.HackRFLNAGain)mComboLNAGain.getSelectedItem() ); + config.setVGAGain( (HackRFTunerController.HackRFVGAGain)mComboVGAGain.getSelectedItem() ); getTunerConfigurationModel().broadcast( - new TunerConfigurationEvent( getConfiguration(), Event.CHANGE ) ); + new TunerConfigurationEvent( getConfiguration(), TunerConfigurationEvent.Event.CHANGE ) ); } } } diff --git a/src/source/tuner/rtl/RTL2832Tuner.java b/src/main/java/io/github/dsheirer/source/tuner/rtl/RTL2832Tuner.java similarity index 84% rename from src/source/tuner/rtl/RTL2832Tuner.java rename to src/main/java/io/github/dsheirer/source/tuner/rtl/RTL2832Tuner.java index 20b746ea..7066dbcc 100644 --- a/src/source/tuner/rtl/RTL2832Tuner.java +++ b/src/main/java/io/github/dsheirer/source/tuner/rtl/RTL2832Tuner.java @@ -15,24 +15,22 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner.rtl; - -import java.util.concurrent.RejectedExecutionException; +package io.github.dsheirer.source.tuner.rtl; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.ComplexBuffer; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.tuner.Tuner; +import io.github.dsheirer.source.tuner.TunerChannel; +import io.github.dsheirer.source.tuner.TunerChannelSource; +import io.github.dsheirer.source.tuner.TunerClass; +import io.github.dsheirer.source.tuner.TunerEvent; +import io.github.dsheirer.source.tuner.TunerType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.usb4java.LibUsbException; -import sample.Listener; -import sample.complex.ComplexBuffer; -import source.SourceException; -import source.tuner.Tuner; -import source.tuner.TunerChannel; -import source.tuner.TunerChannelSource; -import source.tuner.TunerClass; -import source.tuner.TunerEvent; -import source.tuner.TunerType; -import source.tuner.rtl.RTL2832TunerController.SampleRate; +import java.util.concurrent.RejectedExecutionException; public class RTL2832Tuner extends Tuner { @@ -80,7 +78,7 @@ public class RTL2832Tuner extends Tuner return getController().getTunerType(); } - public void setSampleRate( SampleRate sampleRate ) throws SourceException + public void setSampleRate( RTL2832TunerController.SampleRate sampleRate ) throws SourceException { try { @@ -107,7 +105,7 @@ public class RTL2832Tuner extends Tuner } @Override - public TunerChannelSource getChannel( TunerChannel channel ) + public TunerChannelSource getChannel(TunerChannel channel ) throws RejectedExecutionException, SourceException { diff --git a/src/source/tuner/rtl/RTL2832TunerController.java b/src/main/java/io/github/dsheirer/source/tuner/rtl/RTL2832TunerController.java similarity index 98% rename from src/source/tuner/rtl/RTL2832TunerController.java rename to src/main/java/io/github/dsheirer/source/tuner/rtl/RTL2832TunerController.java index 7666890b..7fbfe6c4 100644 --- a/src/source/tuner/rtl/RTL2832TunerController.java +++ b/src/main/java/io/github/dsheirer/source/tuner/rtl/RTL2832TunerController.java @@ -19,8 +19,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner.rtl; +package io.github.dsheirer.source.tuner.rtl; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.adapter.ByteSampleAdapter; +import io.github.dsheirer.sample.adapter.ISampleAdapter; +import io.github.dsheirer.sample.complex.ComplexBuffer; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.tuner.TunerController; +import io.github.dsheirer.source.tuner.TunerManager; +import io.github.dsheirer.source.tuner.TunerType; +import io.github.dsheirer.source.tuner.usb.USBTransferProcessor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.usb4java.Device; @@ -28,16 +37,6 @@ import org.usb4java.DeviceDescriptor; import org.usb4java.DeviceHandle; import org.usb4java.LibUsb; import org.usb4java.LibUsbException; -import sample.Broadcaster; -import sample.Listener; -import sample.adapter.ByteSampleAdapter; -import sample.adapter.ISampleAdapter; -import sample.complex.ComplexBuffer; -import source.SourceException; -import source.tuner.TunerController; -import source.tuner.TunerManager; -import source.tuner.TunerType; -import source.tuner.usb.USBTransferProcessor; import javax.usb.UsbDisconnectedException; import javax.usb.UsbException; diff --git a/src/main/java/io/github/dsheirer/source/tuner/rtl/e4k/E4KTunerConfiguration.java b/src/main/java/io/github/dsheirer/source/tuner/rtl/e4k/E4KTunerConfiguration.java new file mode 100644 index 00000000..85425729 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/rtl/e4k/E4KTunerConfiguration.java @@ -0,0 +1,123 @@ +/******************************************************************************* + * 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 + ******************************************************************************/ +package io.github.dsheirer.source.tuner.rtl.e4k; + +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.github.dsheirer.source.tuner.TunerType; +import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; +import io.github.dsheirer.source.tuner.rtl.RTL2832TunerController; +import io.github.dsheirer.source.tuner.rtl.e4k.E4KTunerController.E4KEnhanceGain; +import io.github.dsheirer.source.tuner.rtl.e4k.E4KTunerController.E4KGain; +import io.github.dsheirer.source.tuner.rtl.e4k.E4KTunerController.E4KLNAGain; +import io.github.dsheirer.source.tuner.rtl.e4k.E4KTunerController.E4KMixerGain; + +public class E4KTunerConfiguration extends TunerConfiguration +{ + private E4KGain mMasterGain = E4KGain.MANUAL; + private E4KMixerGain mMixerGain = E4KMixerGain.GAIN_4; + private E4KLNAGain mLNAGain = E4KLNAGain.GAIN_PLUS_200; + private E4KEnhanceGain mEnhanceGain = E4KEnhanceGain.GAIN_3; + private double mFrequencyCorrection = 0.0d; + private RTL2832TunerController.SampleRate mSampleRate = RTL2832TunerController.SampleRate.RATE_2_400MHZ; + + /** + * Default constructor for JAXB + */ + public E4KTunerConfiguration() + { + } + + public E4KTunerConfiguration(String uniqueID, String name) + { + super(uniqueID, name); + } + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + @Override + public TunerType getTunerType() + { + return TunerType.ELONICS_E4000; + } + + @JacksonXmlProperty(isAttribute = true, localName = "master_gain") + public E4KGain getMasterGain() + { + return mMasterGain; + } + + public void setMasterGain(E4KGain gain) + { + mMasterGain = gain; + } + + @JacksonXmlProperty(isAttribute = true, localName = "mixer_gain") + public E4KMixerGain getMixerGain() + { + return mMixerGain; + } + + public void setMixerGain(E4KMixerGain mixerGain) + { + mMixerGain = mixerGain; + } + + @JacksonXmlProperty(isAttribute = true, localName = "lna_gain") + public E4KLNAGain getLNAGain() + { + return mLNAGain; + } + + public void setLNAGain(E4KLNAGain lnaGain) + { + mLNAGain = lnaGain; + } + + @JacksonXmlProperty(isAttribute = true, localName = "enhance_gain") + public E4KEnhanceGain getEnhanceGain() + { + return mEnhanceGain; + } + + public void setEnhanceGain(E4KEnhanceGain enhanceGain) + { + mEnhanceGain = enhanceGain; + } + + @JacksonXmlProperty(isAttribute = true, localName = "frequency_correction") + public double getFrequencyCorrection() + { + return mFrequencyCorrection; + } + + public void setFrequencyCorrection(double value) + { + mFrequencyCorrection = value; + } + + @JacksonXmlProperty(isAttribute = true, localName = "sample_rate") + public RTL2832TunerController.SampleRate getSampleRate() + { + return mSampleRate; + } + + public void setSampleRate(RTL2832TunerController.SampleRate sampleRate) + { + mSampleRate = sampleRate; + } + +} diff --git a/src/source/tuner/rtl/e4k/E4KTunerController.java b/src/main/java/io/github/dsheirer/source/tuner/rtl/e4k/E4KTunerController.java similarity index 99% rename from src/source/tuner/rtl/e4k/E4KTunerController.java rename to src/main/java/io/github/dsheirer/source/tuner/rtl/e4k/E4KTunerController.java index 5c53621f..90bef77c 100644 --- a/src/source/tuner/rtl/e4k/E4KTunerController.java +++ b/src/main/java/io/github/dsheirer/source/tuner/rtl/e4k/E4KTunerController.java @@ -15,8 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner.rtl.e4k; +package io.github.dsheirer.source.tuner.rtl.e4k; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.tuner.TunerType; +import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; +import io.github.dsheirer.source.tuner.rtl.RTL2832TunerController; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.usb4java.Device; @@ -24,10 +28,6 @@ import org.usb4java.DeviceDescriptor; import org.usb4java.DeviceHandle; import org.usb4java.LibUsb; import org.usb4java.LibUsbException; -import source.SourceException; -import source.tuner.TunerType; -import source.tuner.configuration.TunerConfiguration; -import source.tuner.rtl.RTL2832TunerController; import javax.usb.UsbException; import java.util.Arrays; diff --git a/src/source/tuner/rtl/e4k/E4KTunerEditor.java b/src/main/java/io/github/dsheirer/source/tuner/rtl/e4k/E4KTunerEditor.java similarity index 91% rename from src/source/tuner/rtl/e4k/E4KTunerEditor.java rename to src/main/java/io/github/dsheirer/source/tuner/rtl/e4k/E4KTunerEditor.java index 5989fdf2..cdc64bab 100644 --- a/src/source/tuner/rtl/e4k/E4KTunerEditor.java +++ b/src/main/java/io/github/dsheirer/source/tuner/rtl/e4k/E4KTunerEditor.java @@ -15,47 +15,34 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner.rtl.e4k; +package io.github.dsheirer.source.tuner.rtl.e4k; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; +import io.github.dsheirer.source.tuner.configuration.TunerConfigurationEditor; +import io.github.dsheirer.source.tuner.configuration.TunerConfigurationEvent; +import io.github.dsheirer.source.tuner.configuration.TunerConfigurationModel; +import io.github.dsheirer.source.tuner.rtl.RTL2832Tuner; +import io.github.dsheirer.source.tuner.rtl.RTL2832TunerController; +import io.github.dsheirer.source.tuner.rtl.e4k.E4KTunerController.E4KEnhanceGain; +import io.github.dsheirer.source.tuner.rtl.e4k.E4KTunerController.E4KGain; +import io.github.dsheirer.source.tuner.rtl.e4k.E4KTunerController.E4KLNAGain; +import io.github.dsheirer.source.tuner.rtl.e4k.E4KTunerController.E4KMixerGain; +import net.miginfocom.swing.MigLayout; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.usb4java.LibUsbException; + +import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import javax.usb.UsbException; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.text.DecimalFormat; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JSeparator; -import javax.swing.JSpinner; -import javax.swing.JTextField; -import javax.swing.SpinnerModel; -import javax.swing.SpinnerNumberModel; -import javax.swing.SwingConstants; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.usb.UsbException; - -import net.miginfocom.swing.MigLayout; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.usb4java.LibUsbException; - -import source.SourceException; -import source.tuner.configuration.TunerConfiguration; -import source.tuner.configuration.TunerConfigurationEditor; -import source.tuner.configuration.TunerConfigurationEvent; -import source.tuner.configuration.TunerConfigurationModel; -import source.tuner.rtl.RTL2832Tuner; -import source.tuner.rtl.RTL2832TunerController.Descriptor; -import source.tuner.rtl.RTL2832TunerController.SampleRate; -import source.tuner.rtl.e4k.E4KTunerController.E4KEnhanceGain; -import source.tuner.rtl.e4k.E4KTunerController.E4KGain; -import source.tuner.rtl.e4k.E4KTunerController.E4KLNAGain; -import source.tuner.rtl.e4k.E4KTunerController.E4KMixerGain; - public class E4KTunerEditor extends TunerConfigurationEditor { private final static Logger mLog = LoggerFactory.getLogger( E4KTunerEditor.class ); @@ -64,7 +51,7 @@ public class E4KTunerEditor extends TunerConfigurationEditor private JTextField mConfigurationName; private JButton mTunerInfo; - private JComboBox mComboSampleRate; + private JComboBox mComboSampleRate; private JSpinner mFrequencyCorrection; private JComboBox mComboMasterGain; private JComboBox mComboMixerGain; @@ -74,7 +61,7 @@ public class E4KTunerEditor extends TunerConfigurationEditor private E4KTunerController mController; private boolean mLoading; - public E4KTunerEditor( TunerConfigurationModel tunerConfigurationModel, RTL2832Tuner tuner ) + public E4KTunerEditor(TunerConfigurationModel tunerConfigurationModel, RTL2832Tuner tuner ) { super( tunerConfigurationModel ); mController = (E4KTunerController)tuner.getController(); @@ -131,14 +118,14 @@ public class E4KTunerEditor extends TunerConfigurationEditor } ); add( mTunerInfo ); - mComboSampleRate = new JComboBox<>( SampleRate.values() ); + mComboSampleRate = new JComboBox<>( RTL2832TunerController.SampleRate.values() ); mComboSampleRate.setEnabled( false ); mComboSampleRate.addActionListener( new ActionListener() { @Override public void actionPerformed( ActionEvent e ) { - SampleRate sampleRate = (SampleRate)mComboSampleRate.getSelectedItem(); + RTL2832TunerController.SampleRate sampleRate = (RTL2832TunerController.SampleRate)mComboSampleRate.getSelectedItem(); try { @@ -148,10 +135,10 @@ public class E4KTunerEditor extends TunerConfigurationEditor catch ( SourceException | LibUsbException eSampleRate ) { JOptionPane.showMessageDialog( E4KTunerEditor.this, - "E4K Tuner Controller - couldn't apply the sample rate setting [" + + "E4K Tuner Controller - couldn't apply the sample rate setting [" + sampleRate.getLabel() + "] " + eSampleRate.getLocalizedMessage() ); - mLog.error( "E4K Tuner Controller - couldn't apply sample rate setting [" + + mLog.error( "E4K Tuner Controller - couldn't apply sample rate setting [" + sampleRate.getLabel() + "]", eSampleRate ); } } @@ -392,7 +379,7 @@ public class E4KTunerEditor extends TunerConfigurationEditor { StringBuilder sb = new StringBuilder(); - Descriptor descriptor = mController.getDescriptor(); + RTL2832TunerController.Descriptor descriptor = mController.getDescriptor(); sb.append( "

RTL-2832 with E4000 Tuner

" ); @@ -441,7 +428,7 @@ public class E4KTunerEditor extends TunerConfigurationEditor config.setName( mConfigurationName.getText() ); - config.setSampleRate( (SampleRate)mComboSampleRate.getSelectedItem() ); + config.setSampleRate( (RTL2832TunerController.SampleRate)mComboSampleRate.getSelectedItem() ); double value = ((SpinnerNumberModel)mFrequencyCorrection .getModel()).getNumber().doubleValue(); @@ -452,7 +439,7 @@ public class E4KTunerEditor extends TunerConfigurationEditor config.setLNAGain( (E4KLNAGain)mComboLNAGain.getSelectedItem() ); config.setEnhanceGain( (E4KEnhanceGain)mComboEnhanceGain.getSelectedItem() ); - getTunerConfigurationModel().broadcast( new TunerConfigurationEvent( + getTunerConfigurationModel().broadcast( new TunerConfigurationEvent( getConfiguration(), TunerConfigurationEvent.Event.CHANGE ) ); } diff --git a/src/main/java/io/github/dsheirer/source/tuner/rtl/r820t/R820TTunerConfiguration.java b/src/main/java/io/github/dsheirer/source/tuner/rtl/r820t/R820TTunerConfiguration.java new file mode 100644 index 00000000..bb88c8ef --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/rtl/r820t/R820TTunerConfiguration.java @@ -0,0 +1,118 @@ +/******************************************************************************* + * 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 + ******************************************************************************/ +package io.github.dsheirer.source.tuner.rtl.r820t; + +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.github.dsheirer.source.tuner.TunerType; +import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; +import io.github.dsheirer.source.tuner.rtl.RTL2832TunerController; + +public class R820TTunerConfiguration extends TunerConfiguration +{ + private R820TTunerController.R820TGain mMasterGain = R820TTunerController.R820TGain.GAIN_327; + private R820TTunerController.R820TMixerGain mMixerGain = R820TTunerController.R820TMixerGain.GAIN_105; + private R820TTunerController.R820TLNAGain mLNAGain = R820TTunerController.R820TLNAGain.GAIN_222; + private R820TTunerController.R820TVGAGain mVGAGain = R820TTunerController.R820TVGAGain.GAIN_210; + private double mFrequencyCorrection = 0.0d; + private RTL2832TunerController.SampleRate mSampleRate = RTL2832TunerController.SampleRate.RATE_2_400MHZ; + + /** + * Default constructor for JAXB + */ + public R820TTunerConfiguration() + { + } + + public R820TTunerConfiguration(String uniqueID, String name) + { + super(uniqueID, name); + } + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + @Override + public TunerType getTunerType() + { + return TunerType.RAFAELMICRO_R820T; + } + + @JacksonXmlProperty(isAttribute = true, localName = "master_gain") + public R820TTunerController.R820TGain getMasterGain() + { + return mMasterGain; + } + + public void setMasterGain(R820TTunerController.R820TGain gain) + { + mMasterGain = gain; + } + + @JacksonXmlProperty(isAttribute = true, localName = "mixer_gain") + public R820TTunerController.R820TMixerGain getMixerGain() + { + return mMixerGain; + } + + public void setMixerGain(R820TTunerController.R820TMixerGain mixerGain) + { + mMixerGain = mixerGain; + } + + @JacksonXmlProperty(isAttribute = true, localName = "lna_gain") + public R820TTunerController.R820TLNAGain getLNAGain() + { + return mLNAGain; + } + + public void setLNAGain(R820TTunerController.R820TLNAGain lnaGain) + { + mLNAGain = lnaGain; + } + + @JacksonXmlProperty(isAttribute = true, localName = "vga_gain") + public R820TTunerController.R820TVGAGain getVGAGain() + { + return mVGAGain; + } + + public void setVGAGain(R820TTunerController.R820TVGAGain vgaGain) + { + mVGAGain = vgaGain; + } + + @JacksonXmlProperty(isAttribute = true, localName = "frequency_correction") + public double getFrequencyCorrection() + { + return mFrequencyCorrection; + } + + public void setFrequencyCorrection(double value) + { + mFrequencyCorrection = value; + } + + @JacksonXmlProperty(isAttribute = true, localName = "sample_rate") + public RTL2832TunerController.SampleRate getSampleRate() + { + return mSampleRate; + } + + public void setSampleRate(RTL2832TunerController.SampleRate sampleRate) + { + mSampleRate = sampleRate; + } +} diff --git a/src/source/tuner/rtl/r820t/R820TTunerController.java b/src/main/java/io/github/dsheirer/source/tuner/rtl/r820t/R820TTunerController.java similarity index 99% rename from src/source/tuner/rtl/r820t/R820TTunerController.java rename to src/main/java/io/github/dsheirer/source/tuner/rtl/r820t/R820TTunerController.java index 762cb080..bda2e908 100644 --- a/src/source/tuner/rtl/r820t/R820TTunerController.java +++ b/src/main/java/io/github/dsheirer/source/tuner/rtl/r820t/R820TTunerController.java @@ -20,17 +20,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner.rtl.r820t; +package io.github.dsheirer.source.tuner.rtl.r820t; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.tuner.TunerType; +import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; +import io.github.dsheirer.source.tuner.rtl.RTL2832TunerController; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.usb4java.Device; import org.usb4java.DeviceDescriptor; import org.usb4java.LibUsbException; -import source.SourceException; -import source.tuner.TunerType; -import source.tuner.configuration.TunerConfiguration; -import source.tuner.rtl.RTL2832TunerController; import javax.swing.*; import javax.usb.UsbException; diff --git a/src/source/tuner/rtl/r820t/R820TTunerEditor.java b/src/main/java/io/github/dsheirer/source/tuner/rtl/r820t/R820TTunerEditor.java similarity index 82% rename from src/source/tuner/rtl/r820t/R820TTunerEditor.java rename to src/main/java/io/github/dsheirer/source/tuner/rtl/r820t/R820TTunerEditor.java index c9b75a2e..6558271f 100644 --- a/src/source/tuner/rtl/r820t/R820TTunerEditor.java +++ b/src/main/java/io/github/dsheirer/source/tuner/rtl/r820t/R820TTunerEditor.java @@ -15,68 +15,50 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner.rtl.r820t; +package io.github.dsheirer.source.tuner.rtl.r820t; +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; +import io.github.dsheirer.source.tuner.configuration.TunerConfigurationEditor; +import io.github.dsheirer.source.tuner.configuration.TunerConfigurationEvent; +import io.github.dsheirer.source.tuner.configuration.TunerConfigurationModel; +import io.github.dsheirer.source.tuner.rtl.RTL2832Tuner; +import io.github.dsheirer.source.tuner.rtl.RTL2832TunerController; +import net.miginfocom.swing.MigLayout; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.usb4java.LibUsbException; + +import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import javax.usb.UsbException; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.text.DecimalFormat; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JSeparator; -import javax.swing.JSpinner; -import javax.swing.JTextField; -import javax.swing.SpinnerModel; -import javax.swing.SpinnerNumberModel; -import javax.swing.SwingConstants; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.usb.UsbException; - -import net.miginfocom.swing.MigLayout; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.usb4java.LibUsbException; - -import source.SourceException; -import source.tuner.configuration.TunerConfiguration; -import source.tuner.configuration.TunerConfigurationEditor; -import source.tuner.configuration.TunerConfigurationEvent; -import source.tuner.configuration.TunerConfigurationEvent.Event; -import source.tuner.configuration.TunerConfigurationModel; -import source.tuner.rtl.RTL2832Tuner; -import source.tuner.rtl.RTL2832TunerController.Descriptor; -import source.tuner.rtl.RTL2832TunerController.SampleRate; -import source.tuner.rtl.r820t.R820TTunerController.R820TGain; -import source.tuner.rtl.r820t.R820TTunerController.R820TLNAGain; -import source.tuner.rtl.r820t.R820TTunerController.R820TMixerGain; -import source.tuner.rtl.r820t.R820TTunerController.R820TVGAGain; - public class R820TTunerEditor extends TunerConfigurationEditor { private final static Logger mLog = LoggerFactory.getLogger( R820TTunerEditor.class ); private static final long serialVersionUID = 1L; - private static final R820TGain DEFAULT_GAIN = R820TGain.GAIN_279; + private static final R820TTunerController.R820TGain DEFAULT_GAIN = R820TTunerController.R820TGain.GAIN_279; private R820TTunerController mController; private JTextField mConfigurationName; private JButton mTunerInfo; - private JComboBox mComboSampleRate; + private JComboBox mComboSampleRate; private JSpinner mFrequencyCorrection; - private JComboBox mComboMasterGain; - private JComboBox mComboMixerGain; - private JComboBox mComboLNAGain; - private JComboBox mComboVGAGain; + private JComboBox mComboMasterGain; + private JComboBox mComboMixerGain; + private JComboBox mComboLNAGain; + private JComboBox mComboVGAGain; private boolean mLoading; - public R820TTunerEditor( TunerConfigurationModel tunerConfigurationModel, RTL2832Tuner tuner ) + public R820TTunerEditor(TunerConfigurationModel tunerConfigurationModel, RTL2832Tuner tuner ) { super( tunerConfigurationModel ); mController = (R820TTunerController)tuner.getController(); @@ -130,15 +112,15 @@ public class R820TTunerEditor extends TunerConfigurationEditor } ); add( mTunerInfo ); - mComboSampleRate = new JComboBox<>( SampleRate.values() ); + mComboSampleRate = new JComboBox<>( RTL2832TunerController.SampleRate.values() ); mComboSampleRate.setEnabled( false ); mComboSampleRate.addActionListener( new ActionListener() { @Override public void actionPerformed( ActionEvent e ) { - SampleRate sampleRate = - (SampleRate)mComboSampleRate.getSelectedItem(); + RTL2832TunerController.SampleRate sampleRate = + (RTL2832TunerController.SampleRate)mComboSampleRate.getSelectedItem(); try { @@ -213,7 +195,7 @@ public class R820TTunerEditor extends TunerConfigurationEditor add( new JLabel( "Gain" ), "wrap" ); /* Master Gain Control */ - mComboMasterGain = new JComboBox( R820TGain.values() ); + mComboMasterGain = new JComboBox( R820TTunerController.R820TGain.values() ); mComboMasterGain.setEnabled( false ); mComboMasterGain.addActionListener( new ActionListener() { @@ -222,11 +204,11 @@ public class R820TTunerEditor extends TunerConfigurationEditor { try { - R820TGain gain = (R820TGain)mComboMasterGain.getSelectedItem(); + R820TTunerController.R820TGain gain = (R820TTunerController.R820TGain)mComboMasterGain.getSelectedItem(); - mController.setGain( (R820TGain)mComboMasterGain.getSelectedItem(), true ); + mController.setGain( (R820TTunerController.R820TGain)mComboMasterGain.getSelectedItem(), true ); - if( gain == R820TGain.MANUAL ) + if( gain == R820TTunerController.R820TGain.MANUAL ) { mComboMixerGain.setSelectedItem( gain.getMixerGain() ); mComboMixerGain.setEnabled( true ); @@ -272,7 +254,7 @@ public class R820TTunerEditor extends TunerConfigurationEditor add( mComboMasterGain ); /* Mixer Gain Control */ - mComboMixerGain = new JComboBox( R820TMixerGain.values() ); + mComboMixerGain = new JComboBox( R820TTunerController.R820TMixerGain.values() ); mComboMixerGain.setEnabled( false ); mComboMixerGain.addActionListener( new ActionListener() { @@ -281,8 +263,8 @@ public class R820TTunerEditor extends TunerConfigurationEditor { try { - R820TMixerGain mixerGain = - (R820TMixerGain)mComboMixerGain.getSelectedItem(); + R820TTunerController.R820TMixerGain mixerGain = + (R820TTunerController.R820TMixerGain)mComboMixerGain.getSelectedItem(); if( mixerGain == null ) { @@ -314,7 +296,7 @@ public class R820TTunerEditor extends TunerConfigurationEditor add( mComboMixerGain ); /* LNA Gain Control */ - mComboLNAGain = new JComboBox( R820TLNAGain.values() ); + mComboLNAGain = new JComboBox( R820TTunerController.R820TLNAGain.values() ); mComboLNAGain.setEnabled( false ); mComboLNAGain.addActionListener( new ActionListener() { @@ -323,8 +305,8 @@ public class R820TTunerEditor extends TunerConfigurationEditor { try { - R820TLNAGain lnaGain = - (R820TLNAGain)mComboLNAGain.getSelectedItem(); + R820TTunerController.R820TLNAGain lnaGain = + (R820TTunerController.R820TLNAGain)mComboLNAGain.getSelectedItem(); if ( lnaGain == null ) { @@ -356,7 +338,7 @@ public class R820TTunerEditor extends TunerConfigurationEditor add( mComboLNAGain ); /* VGA Gain Control */ - mComboVGAGain = new JComboBox( R820TVGAGain.values() ); + mComboVGAGain = new JComboBox( R820TTunerController.R820TVGAGain.values() ); mComboVGAGain.setEnabled( false ); mComboVGAGain.addActionListener( new ActionListener() { @@ -365,8 +347,8 @@ public class R820TTunerEditor extends TunerConfigurationEditor { try { - R820TVGAGain vgaGain = - (R820TVGAGain)mComboVGAGain.getSelectedItem(); + R820TTunerController.R820TVGAGain vgaGain = + (R820TTunerController.R820TVGAGain)mComboVGAGain.getSelectedItem(); if( vgaGain == null ) { @@ -447,7 +429,7 @@ public class R820TTunerEditor extends TunerConfigurationEditor { StringBuilder sb = new StringBuilder(); - Descriptor descriptor = mController.getDescriptor(); + RTL2832TunerController.Descriptor descriptor = mController.getDescriptor(); sb.append( "

RTL-2832 with R820T Tuner

" ); @@ -500,22 +482,22 @@ public class R820TTunerEditor extends TunerConfigurationEditor .getModel()).getNumber().doubleValue(); config.setFrequencyCorrection( value ); - config.setSampleRate( (SampleRate)mComboSampleRate.getSelectedItem() ); + config.setSampleRate( (RTL2832TunerController.SampleRate)mComboSampleRate.getSelectedItem() ); - R820TGain gain = (R820TGain)mComboMasterGain.getSelectedItem(); + R820TTunerController.R820TGain gain = (R820TTunerController.R820TGain)mComboMasterGain.getSelectedItem(); config.setMasterGain( gain ); - R820TMixerGain mixerGain = (R820TMixerGain)mComboMixerGain.getSelectedItem(); + R820TTunerController.R820TMixerGain mixerGain = (R820TTunerController.R820TMixerGain)mComboMixerGain.getSelectedItem(); config.setMixerGain( mixerGain ); - R820TLNAGain lnaGain = (R820TLNAGain)mComboLNAGain.getSelectedItem(); + R820TTunerController.R820TLNAGain lnaGain = (R820TTunerController.R820TLNAGain)mComboLNAGain.getSelectedItem(); config.setLNAGain( lnaGain ); - R820TVGAGain vgaGain = (R820TVGAGain)mComboVGAGain.getSelectedItem(); + R820TTunerController.R820TVGAGain vgaGain = (R820TTunerController.R820TVGAGain)mComboVGAGain.getSelectedItem(); config.setVGAGain( vgaGain ); getTunerConfigurationModel().broadcast( - new TunerConfigurationEvent( getConfiguration(), Event.CHANGE ) ); + new TunerConfigurationEvent( getConfiguration(), TunerConfigurationEvent.Event.CHANGE ) ); } } diff --git a/src/source/tuner/usb/USBTransferProcessor.java b/src/main/java/io/github/dsheirer/source/tuner/usb/USBTransferProcessor.java similarity index 97% rename from src/source/tuner/usb/USBTransferProcessor.java rename to src/main/java/io/github/dsheirer/source/tuner/usb/USBTransferProcessor.java index 7052db0c..3331c184 100644 --- a/src/source/tuner/usb/USBTransferProcessor.java +++ b/src/main/java/io/github/dsheirer/source/tuner/usb/USBTransferProcessor.java @@ -16,8 +16,16 @@ * along with this program. If not, see * ******************************************************************************/ -package source.tuner.usb; +package io.github.dsheirer.source.tuner.usb; +import io.github.dsheirer.sample.Broadcaster; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.OverflowableTransferQueue; +import io.github.dsheirer.sample.adapter.ISampleAdapter; +import io.github.dsheirer.sample.complex.ComplexBuffer; +import io.github.dsheirer.sample.real.IOverflowListener; +import io.github.dsheirer.source.tuner.TunerManager; +import io.github.dsheirer.util.ThreadPool; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.usb4java.DeviceHandle; @@ -25,16 +33,7 @@ import org.usb4java.LibUsb; import org.usb4java.LibUsbException; import org.usb4java.Transfer; import org.usb4java.TransferCallback; -import sample.Broadcaster; -import sample.Listener; -import sample.OverflowableTransferQueue; -import sample.adapter.ISampleAdapter; -import sample.complex.ComplexBuffer; -import sample.real.IOverflowListener; -import source.tuner.TunerManager; -import util.ThreadPool; -import javax.usb.UsbException; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; diff --git a/src/source/tuner/usb/USBTunerDevice.java b/src/main/java/io/github/dsheirer/source/tuner/usb/USBTunerDevice.java similarity index 93% rename from src/source/tuner/usb/USBTunerDevice.java rename to src/main/java/io/github/dsheirer/source/tuner/usb/USBTunerDevice.java index 71ef9c6d..6ae068ac 100644 --- a/src/source/tuner/usb/USBTunerDevice.java +++ b/src/main/java/io/github/dsheirer/source/tuner/usb/USBTunerDevice.java @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner.usb; +package io.github.dsheirer.source.tuner.usb; + +import io.github.dsheirer.source.tuner.TunerClass; import javax.usb.UsbDevice; -import source.tuner.TunerClass; - public class USBTunerDevice { private UsbDevice mDevice; diff --git a/src/source/tuner/usb/USBUtils.java b/src/main/java/io/github/dsheirer/source/tuner/usb/USBUtils.java similarity index 98% rename from src/source/tuner/usb/USBUtils.java rename to src/main/java/io/github/dsheirer/source/tuner/usb/USBUtils.java index 8621adf1..bb57c599 100644 --- a/src/source/tuner/usb/USBUtils.java +++ b/src/main/java/io/github/dsheirer/source/tuner/usb/USBUtils.java @@ -15,12 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.tuner.usb; - -import java.io.UnsupportedEncodingException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; +package io.github.dsheirer.source.tuner.usb; import javax.usb.UsbConfiguration; import javax.usb.UsbDevice; @@ -31,6 +26,10 @@ import javax.usb.UsbHostManager; import javax.usb.UsbHub; import javax.usb.UsbInterface; import javax.usb.UsbServices; +import java.io.UnsupportedEncodingException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; public class USBUtils { diff --git a/src/source/wave/ComplexWaveSource.java b/src/main/java/io/github/dsheirer/source/wave/ComplexWaveSource.java similarity index 93% rename from src/source/wave/ComplexWaveSource.java rename to src/main/java/io/github/dsheirer/source/wave/ComplexWaveSource.java index 39e6ef26..8ece68b6 100644 --- a/src/source/wave/ComplexWaveSource.java +++ b/src/main/java/io/github/dsheirer/source/wave/ComplexWaveSource.java @@ -16,18 +16,18 @@ * along with this program. If not, see * ******************************************************************************/ -package source.wave; +package io.github.dsheirer.source.wave; -import channel.heartbeat.Heartbeat; +import io.github.dsheirer.channel.heartbeat.Heartbeat; +import io.github.dsheirer.sample.ConversionUtils; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.ComplexBuffer; +import io.github.dsheirer.source.ComplexSource; +import io.github.dsheirer.source.IControllableFileSource; +import io.github.dsheirer.source.IFrameLocationListener; +import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.ConversionUtils; -import sample.Listener; -import sample.complex.ComplexBuffer; -import source.ComplexSource; -import source.IControllableFileSource; -import source.IFrameLocationListener; -import source.tuner.frequency.FrequencyChangeEvent; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; diff --git a/src/source/wave/RealWaveSource.java b/src/main/java/io/github/dsheirer/source/wave/RealWaveSource.java similarity index 94% rename from src/source/wave/RealWaveSource.java rename to src/main/java/io/github/dsheirer/source/wave/RealWaveSource.java index a17efb49..b41042b8 100644 --- a/src/source/wave/RealWaveSource.java +++ b/src/main/java/io/github/dsheirer/source/wave/RealWaveSource.java @@ -15,18 +15,18 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package source.wave; +package io.github.dsheirer.source.wave; -import channel.heartbeat.Heartbeat; +import io.github.dsheirer.channel.heartbeat.Heartbeat; +import io.github.dsheirer.sample.ConversionUtils; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.RealBuffer; +import io.github.dsheirer.source.IControllableFileSource; +import io.github.dsheirer.source.IFrameLocationListener; +import io.github.dsheirer.source.RealSource; +import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sample.ConversionUtils; -import sample.Listener; -import sample.real.RealBuffer; -import source.IControllableFileSource; -import source.IFrameLocationListener; -import source.RealSource; -import source.tuner.frequency.FrequencyChangeEvent; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; diff --git a/src/spectrum/ChannelOverlayPanel.java b/src/main/java/io/github/dsheirer/spectrum/ChannelOverlayPanel.java similarity index 95% rename from src/spectrum/ChannelOverlayPanel.java rename to src/main/java/io/github/dsheirer/spectrum/ChannelOverlayPanel.java index bd40571c..5a74fa04 100644 --- a/src/spectrum/ChannelOverlayPanel.java +++ b/src/main/java/io/github/dsheirer/spectrum/ChannelOverlayPanel.java @@ -15,26 +15,20 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package spectrum; +package io.github.dsheirer.spectrum; -import java.awt.Color; -import java.awt.FontMetrics; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Point; -import java.awt.RenderingHints; +import io.github.dsheirer.settings.ColorSetting; +import io.github.dsheirer.settings.ColorSetting.ColorSettingName; +import io.github.dsheirer.settings.Setting; +import io.github.dsheirer.settings.SettingChangeListener; +import io.github.dsheirer.settings.SettingsManager; + +import javax.swing.*; +import java.awt.*; import java.awt.geom.Line2D; import java.awt.geom.Rectangle2D; import java.text.DecimalFormat; -import javax.swing.JPanel; - -import settings.ColorSetting; -import settings.ColorSetting.ColorSettingName; -import settings.Setting; -import settings.SettingChangeListener; -import settings.SettingsManager; - public class ChannelOverlayPanel extends JPanel implements SettingChangeListener { private static final long serialVersionUID = 1L; diff --git a/src/spectrum/ChannelSpectrumPanel.java b/src/main/java/io/github/dsheirer/spectrum/ChannelSpectrumPanel.java similarity index 86% rename from src/spectrum/ChannelSpectrumPanel.java rename to src/main/java/io/github/dsheirer/spectrum/ChannelSpectrumPanel.java index 397c3604..7b7bf9d0 100644 --- a/src/spectrum/ChannelSpectrumPanel.java +++ b/src/main/java/io/github/dsheirer/spectrum/ChannelSpectrumPanel.java @@ -1,6 +1,37 @@ -package spectrum; +package io.github.dsheirer.spectrum; -import java.awt.Component; +import io.github.dsheirer.controller.channel.Channel; +import io.github.dsheirer.controller.channel.ChannelEvent; +import io.github.dsheirer.controller.channel.ChannelEventListener; +import io.github.dsheirer.controller.channel.ChannelProcessingManager; +import io.github.dsheirer.dsp.filter.Filters; +import io.github.dsheirer.dsp.filter.Window.WindowType; +import io.github.dsheirer.dsp.filter.halfband.real.HalfBandFilter_RB_RB; +import io.github.dsheirer.dsp.filter.smoothing.SmoothingFilter.SmoothingType; +import io.github.dsheirer.module.ProcessingChain; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.SampleType; +import io.github.dsheirer.sample.complex.ComplexBuffer; +import io.github.dsheirer.sample.real.RealBuffer; +import io.github.dsheirer.settings.ColorSetting.ColorSettingName; +import io.github.dsheirer.settings.ColorSettingMenuItem; +import io.github.dsheirer.settings.Setting; +import io.github.dsheirer.settings.SettingChangeListener; +import io.github.dsheirer.settings.SettingsManager; +import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent; +import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent.Event; +import io.github.dsheirer.spectrum.converter.DFTResultsConverter; +import io.github.dsheirer.spectrum.converter.RealDecibelConverter; +import io.github.dsheirer.spectrum.menu.AveragingItem; +import io.github.dsheirer.spectrum.menu.DFTSizeItem; +import io.github.dsheirer.spectrum.menu.FFTWindowTypeItem; +import io.github.dsheirer.spectrum.menu.FrameRateItem; +import io.github.dsheirer.spectrum.menu.SmoothingItem; +import io.github.dsheirer.spectrum.menu.SmoothingTypeItem; +import net.miginfocom.swing.MigLayout; + +import javax.swing.*; +import java.awt.*; import java.awt.event.ComponentEvent; import java.awt.event.ComponentListener; import java.awt.event.MouseEvent; @@ -8,43 +39,6 @@ import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.util.concurrent.atomic.AtomicBoolean; -import javax.swing.JLayeredPane; -import javax.swing.JMenu; -import javax.swing.JPanel; -import javax.swing.JPopupMenu; -import javax.swing.JSeparator; -import javax.swing.SwingUtilities; - -import module.ProcessingChain; -import net.miginfocom.swing.MigLayout; -import sample.Listener; -import sample.SampleType; -import sample.complex.ComplexBuffer; -import sample.real.RealBuffer; -import settings.ColorSetting.ColorSettingName; -import settings.ColorSettingMenuItem; -import settings.Setting; -import settings.SettingChangeListener; -import settings.SettingsManager; -import source.tuner.frequency.FrequencyChangeEvent; -import source.tuner.frequency.FrequencyChangeEvent.Event; -import spectrum.converter.DFTResultsConverter; -import spectrum.converter.RealDecibelConverter; -import spectrum.menu.AveragingItem; -import spectrum.menu.DFTSizeItem; -import spectrum.menu.FFTWindowTypeItem; -import spectrum.menu.FrameRateItem; -import spectrum.menu.SmoothingItem; -import spectrum.menu.SmoothingTypeItem; -import controller.channel.Channel; -import controller.channel.ChannelEvent; -import controller.channel.ChannelEventListener; -import controller.channel.ChannelProcessingManager; -import dsp.filter.Filters; -import dsp.filter.Window.WindowType; -import dsp.filter.halfband.real.HalfBandFilter_RB_RB; -import dsp.filter.smoothing.SmoothingFilter.SmoothingType; - public class ChannelSpectrumPanel extends JPanel implements ChannelEventListener, Listener, @@ -159,8 +153,8 @@ public class ChannelSpectrumPanel extends JPanel switch( event.getEvent() ) { case NOTIFICATION_SELECTION_CHANGE: - //ChannelSelectionManager ensures that only 1 channel can be - //selected and any previously selected channel will be first + //ChannelSelectionManager ensures that only 1 channel can be + //selected and any previously selected channel will be first //deselected before we get a new selection event if( event.getChannel().isSelected() ) { diff --git a/src/spectrum/DFTProcessor.java b/src/main/java/io/github/dsheirer/spectrum/DFTProcessor.java similarity index 95% rename from src/spectrum/DFTProcessor.java rename to src/main/java/io/github/dsheirer/spectrum/DFTProcessor.java index 795c3f2b..b69628be 100644 --- a/src/spectrum/DFTProcessor.java +++ b/src/main/java/io/github/dsheirer/spectrum/DFTProcessor.java @@ -16,22 +16,22 @@ * along with this program. If not, see * ******************************************************************************/ -package spectrum; +package io.github.dsheirer.spectrum; -import dsp.filter.Window; -import dsp.filter.Window.WindowType; +import io.github.dsheirer.dsp.filter.Window; +import io.github.dsheirer.dsp.filter.Window.WindowType; +import io.github.dsheirer.properties.SystemProperties; +import io.github.dsheirer.sample.Buffer; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.SampleType; +import io.github.dsheirer.sample.complex.ComplexBuffer; +import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent; +import io.github.dsheirer.source.tuner.frequency.IFrequencyChangeProcessor; +import io.github.dsheirer.spectrum.converter.DFTResultsConverter; +import io.github.dsheirer.util.ThreadPool; import org.jtransforms.fft.FloatFFT_1D; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import properties.SystemProperties; -import sample.Buffer; -import sample.Listener; -import sample.SampleType; -import sample.complex.ComplexBuffer; -import source.tuner.frequency.FrequencyChangeEvent; -import source.tuner.frequency.IFrequencyChangeProcessor; -import spectrum.converter.DFTResultsConverter; -import util.ThreadPool; import java.util.Arrays; import java.util.Iterator; diff --git a/src/spectrum/DFTResultsListener.java b/src/main/java/io/github/dsheirer/spectrum/DFTResultsListener.java similarity index 96% rename from src/spectrum/DFTResultsListener.java rename to src/main/java/io/github/dsheirer/spectrum/DFTResultsListener.java index 18b2fb11..ce90c1fd 100644 --- a/src/spectrum/DFTResultsListener.java +++ b/src/main/java/io/github/dsheirer/spectrum/DFTResultsListener.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package spectrum; +package io.github.dsheirer.spectrum; /** * Interface for passing the output of DFT processing diff --git a/src/spectrum/DFTResultsProvider.java b/src/main/java/io/github/dsheirer/spectrum/DFTResultsProvider.java similarity index 96% rename from src/spectrum/DFTResultsProvider.java rename to src/main/java/io/github/dsheirer/spectrum/DFTResultsProvider.java index b26f8ebb..b171bc9d 100644 --- a/src/spectrum/DFTResultsProvider.java +++ b/src/main/java/io/github/dsheirer/spectrum/DFTResultsProvider.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package spectrum; +package io.github.dsheirer.spectrum; public interface DFTResultsProvider { diff --git a/src/spectrum/DFTSize.java b/src/main/java/io/github/dsheirer/spectrum/DFTSize.java similarity index 97% rename from src/spectrum/DFTSize.java rename to src/main/java/io/github/dsheirer/spectrum/DFTSize.java index eabfa977..918462eb 100644 --- a/src/spectrum/DFTSize.java +++ b/src/main/java/io/github/dsheirer/spectrum/DFTSize.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package spectrum; +package io.github.dsheirer.spectrum; public enum DFTSize { diff --git a/src/spectrum/IDFTWidthChangeProcessor.java b/src/main/java/io/github/dsheirer/spectrum/IDFTWidthChangeProcessor.java similarity index 76% rename from src/spectrum/IDFTWidthChangeProcessor.java rename to src/main/java/io/github/dsheirer/spectrum/IDFTWidthChangeProcessor.java index 29795333..76714e66 100644 --- a/src/spectrum/IDFTWidthChangeProcessor.java +++ b/src/main/java/io/github/dsheirer/spectrum/IDFTWidthChangeProcessor.java @@ -1,4 +1,4 @@ -package spectrum; +package io.github.dsheirer.spectrum; public interface IDFTWidthChangeProcessor { diff --git a/src/spectrum/OverlayPanel.java b/src/main/java/io/github/dsheirer/spectrum/OverlayPanel.java similarity index 97% rename from src/spectrum/OverlayPanel.java rename to src/main/java/io/github/dsheirer/spectrum/OverlayPanel.java index b064b804..d1317e11 100644 --- a/src/spectrum/OverlayPanel.java +++ b/src/main/java/io/github/dsheirer/spectrum/OverlayPanel.java @@ -16,23 +16,23 @@ * along with this program. If not, see * ******************************************************************************/ -package spectrum; +package io.github.dsheirer.spectrum; -import controller.channel.Channel; -import controller.channel.Channel.ChannelType; -import controller.channel.ChannelEvent; -import controller.channel.ChannelEventListener; -import controller.channel.ChannelModel; +import io.github.dsheirer.controller.channel.Channel; +import io.github.dsheirer.controller.channel.Channel.ChannelType; +import io.github.dsheirer.controller.channel.ChannelEvent; +import io.github.dsheirer.controller.channel.ChannelEventListener; +import io.github.dsheirer.controller.channel.ChannelModel; +import io.github.dsheirer.settings.ColorSetting; +import io.github.dsheirer.settings.ColorSetting.ColorSettingName; +import io.github.dsheirer.settings.Setting; +import io.github.dsheirer.settings.SettingChangeListener; +import io.github.dsheirer.settings.SettingsManager; +import io.github.dsheirer.source.tuner.TunerChannel; +import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent; +import io.github.dsheirer.source.tuner.frequency.IFrequencyChangeProcessor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import settings.ColorSetting; -import settings.ColorSetting.ColorSettingName; -import settings.Setting; -import settings.SettingChangeListener; -import settings.SettingsManager; -import source.tuner.TunerChannel; -import source.tuner.frequency.FrequencyChangeEvent; -import source.tuner.frequency.IFrequencyChangeProcessor; import javax.swing.*; import java.awt.*; diff --git a/src/spectrum/Pausable.java b/src/main/java/io/github/dsheirer/spectrum/Pausable.java similarity index 95% rename from src/spectrum/Pausable.java rename to src/main/java/io/github/dsheirer/spectrum/Pausable.java index bc752e40..7c13837d 100644 --- a/src/spectrum/Pausable.java +++ b/src/main/java/io/github/dsheirer/spectrum/Pausable.java @@ -15,10 +15,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package spectrum; +package io.github.dsheirer.spectrum; /** - * Interface to add pause action to moving displays like the spectrum and + * Interface to add pause action to moving displays like the spectrum and * waterfall panels */ public interface Pausable diff --git a/src/spectrum/SpectralDisplayAdjuster.java b/src/main/java/io/github/dsheirer/spectrum/SpectralDisplayAdjuster.java similarity index 77% rename from src/spectrum/SpectralDisplayAdjuster.java rename to src/main/java/io/github/dsheirer/spectrum/SpectralDisplayAdjuster.java index 1d288086..b062ded5 100644 --- a/src/spectrum/SpectralDisplayAdjuster.java +++ b/src/main/java/io/github/dsheirer/spectrum/SpectralDisplayAdjuster.java @@ -1,6 +1,6 @@ -package spectrum; +package io.github.dsheirer.spectrum; -import dsp.filter.smoothing.SmoothingFilter.SmoothingType; +import io.github.dsheirer.dsp.filter.smoothing.SmoothingFilter.SmoothingType; public interface SpectralDisplayAdjuster { @@ -14,7 +14,7 @@ public interface SpectralDisplayAdjuster public void setAveraging( int averaging ); /** - * Sets the smoothing filter averaging window width. + * Sets the smoothing filter averaging window width. * * Valid values are odd in the range 3 - 29 */ diff --git a/src/spectrum/SpectralDisplayPanel.java b/src/main/java/io/github/dsheirer/spectrum/SpectralDisplayPanel.java similarity index 94% rename from src/spectrum/SpectralDisplayPanel.java rename to src/main/java/io/github/dsheirer/spectrum/SpectralDisplayPanel.java index 505c17e0..6ade9244 100644 --- a/src/spectrum/SpectralDisplayPanel.java +++ b/src/main/java/io/github/dsheirer/spectrum/SpectralDisplayPanel.java @@ -16,39 +16,39 @@ * along with this program. If not, see * ******************************************************************************/ -package spectrum; +package io.github.dsheirer.spectrum; import com.jidesoft.swing.JideSplitPane; -import controller.channel.Channel; -import controller.channel.ChannelModel; -import controller.channel.ChannelProcessingManager; -import controller.channel.ChannelUtils; -import dsp.filter.Window.WindowType; -import dsp.filter.smoothing.SmoothingFilter.SmoothingType; -import module.decode.DecoderType; +import io.github.dsheirer.controller.channel.Channel; +import io.github.dsheirer.controller.channel.ChannelModel; +import io.github.dsheirer.controller.channel.ChannelProcessingManager; +import io.github.dsheirer.controller.channel.ChannelUtils; +import io.github.dsheirer.dsp.filter.Window.WindowType; +import io.github.dsheirer.dsp.filter.smoothing.SmoothingFilter.SmoothingType; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.properties.SystemProperties; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.SampleType; +import io.github.dsheirer.sample.complex.ComplexBuffer; +import io.github.dsheirer.settings.ColorSetting.ColorSettingName; +import io.github.dsheirer.settings.ColorSettingMenuItem; +import io.github.dsheirer.settings.SettingsManager; +import io.github.dsheirer.source.tuner.Tuner; +import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent; +import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent.Event; +import io.github.dsheirer.source.tuner.frequency.IFrequencyChangeProcessor; +import io.github.dsheirer.spectrum.OverlayPanel.ChannelDisplay; +import io.github.dsheirer.spectrum.converter.ComplexDecibelConverter; +import io.github.dsheirer.spectrum.converter.DFTResultsConverter; +import io.github.dsheirer.spectrum.menu.AveragingItem; +import io.github.dsheirer.spectrum.menu.DFTSizeItem; +import io.github.dsheirer.spectrum.menu.FFTWindowTypeItem; +import io.github.dsheirer.spectrum.menu.FrameRateItem; +import io.github.dsheirer.spectrum.menu.SmoothingItem; +import io.github.dsheirer.spectrum.menu.SmoothingTypeItem; import net.miginfocom.swing.MigLayout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import properties.SystemProperties; -import sample.Listener; -import sample.SampleType; -import sample.complex.ComplexBuffer; -import settings.ColorSetting.ColorSettingName; -import settings.ColorSettingMenuItem; -import settings.SettingsManager; -import source.tuner.Tuner; -import source.tuner.frequency.FrequencyChangeEvent; -import source.tuner.frequency.FrequencyChangeEvent.Event; -import source.tuner.frequency.IFrequencyChangeProcessor; -import spectrum.OverlayPanel.ChannelDisplay; -import spectrum.converter.ComplexDecibelConverter; -import spectrum.converter.DFTResultsConverter; -import spectrum.menu.AveragingItem; -import spectrum.menu.DFTSizeItem; -import spectrum.menu.FFTWindowTypeItem; -import spectrum.menu.FrameRateItem; -import spectrum.menu.SmoothingItem; -import spectrum.menu.SmoothingTypeItem; import javax.swing.*; import javax.swing.event.ChangeEvent; diff --git a/src/spectrum/SpectrumFrame.java b/src/main/java/io/github/dsheirer/spectrum/SpectrumFrame.java similarity index 89% rename from src/spectrum/SpectrumFrame.java rename to src/main/java/io/github/dsheirer/spectrum/SpectrumFrame.java index a3e1e5d1..9da80093 100644 --- a/src/spectrum/SpectrumFrame.java +++ b/src/main/java/io/github/dsheirer/spectrum/SpectrumFrame.java @@ -15,20 +15,19 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package spectrum; +package io.github.dsheirer.spectrum; -import java.awt.EventQueue; +import io.github.dsheirer.controller.channel.ChannelModel; +import io.github.dsheirer.controller.channel.ChannelProcessingManager; +import io.github.dsheirer.settings.SettingsManager; +import io.github.dsheirer.source.tuner.Tuner; +import net.miginfocom.swing.MigLayout; + +import javax.swing.*; +import java.awt.*; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; -import javax.swing.JFrame; - -import net.miginfocom.swing.MigLayout; -import settings.SettingsManager; -import source.tuner.Tuner; -import controller.channel.ChannelModel; -import controller.channel.ChannelProcessingManager; - public class SpectrumFrame extends JFrame implements WindowListener { private static final long serialVersionUID = 1L; diff --git a/src/spectrum/SpectrumPanel.java b/src/main/java/io/github/dsheirer/spectrum/SpectrumPanel.java similarity index 94% rename from src/spectrum/SpectrumPanel.java rename to src/main/java/io/github/dsheirer/spectrum/SpectrumPanel.java index 156ab50f..54738e6f 100644 --- a/src/spectrum/SpectrumPanel.java +++ b/src/main/java/io/github/dsheirer/spectrum/SpectrumPanel.java @@ -16,22 +16,22 @@ * along with this program. If not, see * ******************************************************************************/ -package spectrum; +package io.github.dsheirer.spectrum; -import dsp.filter.smoothing.GaussianSmoothingFilter; -import dsp.filter.smoothing.NoSmoothingFilter; -import dsp.filter.smoothing.RectangularSmoothingFilter; -import dsp.filter.smoothing.SmoothingFilter; -import dsp.filter.smoothing.SmoothingFilter.SmoothingType; -import dsp.filter.smoothing.TriangularSmoothingFilter; +import io.github.dsheirer.dsp.filter.smoothing.GaussianSmoothingFilter; +import io.github.dsheirer.dsp.filter.smoothing.NoSmoothingFilter; +import io.github.dsheirer.dsp.filter.smoothing.RectangularSmoothingFilter; +import io.github.dsheirer.dsp.filter.smoothing.SmoothingFilter; +import io.github.dsheirer.dsp.filter.smoothing.SmoothingFilter.SmoothingType; +import io.github.dsheirer.dsp.filter.smoothing.TriangularSmoothingFilter; +import io.github.dsheirer.settings.ColorSetting; +import io.github.dsheirer.settings.ColorSetting.ColorSettingName; +import io.github.dsheirer.settings.Setting; +import io.github.dsheirer.settings.SettingChangeListener; +import io.github.dsheirer.settings.SettingsManager; import org.apache.commons.lang3.Validate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import settings.ColorSetting; -import settings.ColorSetting.ColorSettingName; -import settings.Setting; -import settings.SettingChangeListener; -import settings.SettingsManager; import javax.swing.*; import java.awt.*; diff --git a/src/spectrum/WaterfallColorModel.java b/src/main/java/io/github/dsheirer/spectrum/WaterfallColorModel.java similarity index 98% rename from src/spectrum/WaterfallColorModel.java rename to src/main/java/io/github/dsheirer/spectrum/WaterfallColorModel.java index 7f338df4..dab08be0 100644 --- a/src/spectrum/WaterfallColorModel.java +++ b/src/main/java/io/github/dsheirer/spectrum/WaterfallColorModel.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package spectrum; +package io.github.dsheirer.spectrum; import java.awt.image.IndexColorModel; diff --git a/src/spectrum/WaterfallPanel.java b/src/main/java/io/github/dsheirer/spectrum/WaterfallPanel.java similarity index 96% rename from src/spectrum/WaterfallPanel.java rename to src/main/java/io/github/dsheirer/spectrum/WaterfallPanel.java index a1c55421..cec5c673 100644 --- a/src/spectrum/WaterfallPanel.java +++ b/src/main/java/io/github/dsheirer/spectrum/WaterfallPanel.java @@ -15,30 +15,23 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package spectrum; +package io.github.dsheirer.spectrum; -import java.awt.Color; -import java.awt.EventQueue; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Image; -import java.awt.Point; +import io.github.dsheirer.settings.ColorSetting; +import io.github.dsheirer.settings.ColorSetting.ColorSettingName; +import io.github.dsheirer.settings.Setting; +import io.github.dsheirer.settings.SettingChangeListener; +import io.github.dsheirer.settings.SettingsManager; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.swing.*; +import java.awt.*; import java.awt.geom.Line2D; import java.awt.image.ColorModel; import java.awt.image.MemoryImageSource; import java.text.DecimalFormat; -import javax.swing.JPanel; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import settings.ColorSetting; -import settings.ColorSetting.ColorSettingName; -import settings.Setting; -import settings.SettingChangeListener; -import settings.SettingsManager; - public class WaterfallPanel extends JPanel implements DFTResultsListener, Pausable, SettingChangeListener @@ -71,7 +64,7 @@ public class WaterfallPanel extends JPanel implements DFTResultsListener, /** * Displays a scrolling window of multiple DFT frequency bin outputs over - * time. Maps DFT frequency bin decibel values into a 256 bucket color map + * time. Maps DFT frequency bin decibel values into a 256 bucket color map * for display. * * @param settingsManager diff --git a/src/spectrum/converter/ComplexDecibelConverter.java b/src/main/java/io/github/dsheirer/spectrum/converter/ComplexDecibelConverter.java similarity index 98% rename from src/spectrum/converter/ComplexDecibelConverter.java rename to src/main/java/io/github/dsheirer/spectrum/converter/ComplexDecibelConverter.java index ec7c55ab..fb063d58 100644 --- a/src/spectrum/converter/ComplexDecibelConverter.java +++ b/src/main/java/io/github/dsheirer/spectrum/converter/ComplexDecibelConverter.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package spectrum.converter; +package io.github.dsheirer.spectrum.converter; /** @@ -46,7 +46,7 @@ package spectrum.converter; * * 20 * log10( 1 / ( 2 ^ ( bit depth - 1 ) ) * - * A source that provides 12-bit samples can produce values in the range of + * A source that provides 12-bit samples can produce values in the range of * ( 0 to 4096 ) or -2048 to 2047. The smallest observable value would then * be 1 / 2048. * @@ -61,7 +61,7 @@ public class ComplexDecibelConverter extends DFTResultsConverter { /** * Converts the output of the JTransforms FloatFFT_1D.complexForward() - * calculation into the power spectrum in decibels, normalized to the + * calculation into the power spectrum in decibels, normalized to the * sample bit depth. */ public ComplexDecibelConverter() diff --git a/src/spectrum/converter/DFTResultsConverter.java b/src/main/java/io/github/dsheirer/spectrum/converter/DFTResultsConverter.java similarity index 84% rename from src/spectrum/converter/DFTResultsConverter.java rename to src/main/java/io/github/dsheirer/spectrum/converter/DFTResultsConverter.java index d9e43574..bdce5416 100644 --- a/src/spectrum/converter/DFTResultsConverter.java +++ b/src/main/java/io/github/dsheirer/spectrum/converter/DFTResultsConverter.java @@ -1,10 +1,10 @@ -package spectrum.converter; +package io.github.dsheirer.spectrum.converter; + +import io.github.dsheirer.spectrum.DFTResultsListener; +import io.github.dsheirer.spectrum.DFTResultsProvider; import java.util.concurrent.CopyOnWriteArrayList; -import spectrum.DFTResultsListener; -import spectrum.DFTResultsProvider; - public abstract class DFTResultsConverter implements DFTResultsListener, DFTResultsProvider { diff --git a/src/spectrum/converter/RealDecibelConverter.java b/src/main/java/io/github/dsheirer/spectrum/converter/RealDecibelConverter.java similarity index 95% rename from src/spectrum/converter/RealDecibelConverter.java rename to src/main/java/io/github/dsheirer/spectrum/converter/RealDecibelConverter.java index ae620b50..34343a1e 100644 --- a/src/spectrum/converter/RealDecibelConverter.java +++ b/src/main/java/io/github/dsheirer/spectrum/converter/RealDecibelConverter.java @@ -1,4 +1,4 @@ -package spectrum.converter; +package io.github.dsheirer.spectrum.converter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/spectrum/menu/AveragingItem.java b/src/main/java/io/github/dsheirer/spectrum/menu/AveragingItem.java similarity index 91% rename from src/spectrum/menu/AveragingItem.java rename to src/main/java/io/github/dsheirer/spectrum/menu/AveragingItem.java index c971e465..3d05a407 100644 --- a/src/spectrum/menu/AveragingItem.java +++ b/src/main/java/io/github/dsheirer/spectrum/menu/AveragingItem.java @@ -1,13 +1,12 @@ -package spectrum.menu; +package io.github.dsheirer.spectrum.menu; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; +import io.github.dsheirer.spectrum.SpectralDisplayAdjuster; -import javax.swing.JSlider; +import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; - -import spectrum.SpectralDisplayAdjuster; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; public class AveragingItem extends JSlider implements ChangeListener { diff --git a/src/spectrum/menu/DFTSizeItem.java b/src/main/java/io/github/dsheirer/spectrum/menu/DFTSizeItem.java similarity index 81% rename from src/spectrum/menu/DFTSizeItem.java rename to src/main/java/io/github/dsheirer/spectrum/menu/DFTSizeItem.java index cb8a6aa3..f8973a82 100644 --- a/src/spectrum/menu/DFTSizeItem.java +++ b/src/main/java/io/github/dsheirer/spectrum/menu/DFTSizeItem.java @@ -1,13 +1,12 @@ -package spectrum.menu; +package io.github.dsheirer.spectrum.menu; +import io.github.dsheirer.spectrum.DFTSize; +import io.github.dsheirer.spectrum.IDFTWidthChangeProcessor; + +import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import javax.swing.JCheckBoxMenuItem; - -import spectrum.DFTSize; -import spectrum.IDFTWidthChangeProcessor; - public class DFTSizeItem extends JCheckBoxMenuItem { private static final long serialVersionUID = 1L; diff --git a/src/spectrum/menu/FFTWindowTypeItem.java b/src/main/java/io/github/dsheirer/spectrum/menu/FFTWindowTypeItem.java similarity index 82% rename from src/spectrum/menu/FFTWindowTypeItem.java rename to src/main/java/io/github/dsheirer/spectrum/menu/FFTWindowTypeItem.java index 6a2aacbf..843cc0a0 100644 --- a/src/spectrum/menu/FFTWindowTypeItem.java +++ b/src/main/java/io/github/dsheirer/spectrum/menu/FFTWindowTypeItem.java @@ -1,13 +1,12 @@ -package spectrum.menu; +package io.github.dsheirer.spectrum.menu; +import io.github.dsheirer.dsp.filter.Window.WindowType; +import io.github.dsheirer.spectrum.DFTProcessor; + +import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import javax.swing.JCheckBoxMenuItem; - -import spectrum.DFTProcessor; -import dsp.filter.Window.WindowType; - public class FFTWindowTypeItem extends JCheckBoxMenuItem { private static final long serialVersionUID = 1L; diff --git a/src/spectrum/menu/FrameRateItem.java b/src/main/java/io/github/dsheirer/spectrum/menu/FrameRateItem.java similarity index 86% rename from src/spectrum/menu/FrameRateItem.java rename to src/main/java/io/github/dsheirer/spectrum/menu/FrameRateItem.java index 3101e6d4..cb6c6cf3 100644 --- a/src/spectrum/menu/FrameRateItem.java +++ b/src/main/java/io/github/dsheirer/spectrum/menu/FrameRateItem.java @@ -1,12 +1,11 @@ -package spectrum.menu; +package io.github.dsheirer.spectrum.menu; +import io.github.dsheirer.spectrum.DFTProcessor; + +import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import javax.swing.JCheckBoxMenuItem; - -import spectrum.DFTProcessor; - public class FrameRateItem extends JCheckBoxMenuItem { private static final long serialVersionUID = 1L; diff --git a/src/spectrum/menu/SmoothingItem.java b/src/main/java/io/github/dsheirer/spectrum/menu/SmoothingItem.java similarity index 91% rename from src/spectrum/menu/SmoothingItem.java rename to src/main/java/io/github/dsheirer/spectrum/menu/SmoothingItem.java index cef171ab..f99436ca 100644 --- a/src/spectrum/menu/SmoothingItem.java +++ b/src/main/java/io/github/dsheirer/spectrum/menu/SmoothingItem.java @@ -1,17 +1,15 @@ -package spectrum.menu; +package io.github.dsheirer.spectrum.menu; +import io.github.dsheirer.dsp.filter.smoothing.SmoothingFilter; +import io.github.dsheirer.spectrum.SpectralDisplayAdjuster; + +import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.util.Hashtable; -import javax.swing.JLabel; -import javax.swing.JSlider; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - -import spectrum.SpectralDisplayAdjuster; -import dsp.filter.smoothing.SmoothingFilter; - public class SmoothingItem extends JSlider implements ChangeListener { private static final long serialVersionUID = 1L; diff --git a/src/spectrum/menu/SmoothingTypeItem.java b/src/main/java/io/github/dsheirer/spectrum/menu/SmoothingTypeItem.java similarity index 76% rename from src/spectrum/menu/SmoothingTypeItem.java rename to src/main/java/io/github/dsheirer/spectrum/menu/SmoothingTypeItem.java index 312b2123..c3f7df99 100644 --- a/src/spectrum/menu/SmoothingTypeItem.java +++ b/src/main/java/io/github/dsheirer/spectrum/menu/SmoothingTypeItem.java @@ -1,13 +1,12 @@ -package spectrum.menu; +package io.github.dsheirer.spectrum.menu; +import io.github.dsheirer.dsp.filter.smoothing.SmoothingFilter.SmoothingType; +import io.github.dsheirer.spectrum.SpectralDisplayAdjuster; + +import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import javax.swing.JCheckBoxMenuItem; - -import spectrum.SpectralDisplayAdjuster; -import dsp.filter.smoothing.SmoothingFilter.SmoothingType; - public class SmoothingTypeItem extends JCheckBoxMenuItem { private static final long serialVersionUID = 1L; diff --git a/src/util/Angle.java b/src/main/java/io/github/dsheirer/util/Angle.java similarity index 97% rename from src/util/Angle.java rename to src/main/java/io/github/dsheirer/util/Angle.java index 5cb1c2d2..1fbd868f 100644 --- a/src/util/Angle.java +++ b/src/main/java/io/github/dsheirer/util/Angle.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package util; +package io.github.dsheirer.util; public class Angle { diff --git a/src/util/ArcTangent.java b/src/main/java/io/github/dsheirer/util/ArcTangent.java similarity index 99% rename from src/util/ArcTangent.java rename to src/main/java/io/github/dsheirer/util/ArcTangent.java index 234621b5..77be9d97 100644 --- a/src/util/ArcTangent.java +++ b/src/main/java/io/github/dsheirer/util/ArcTangent.java @@ -38,9 +38,9 @@ * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ -package util; +package io.github.dsheirer.util; -import sample.complex.Complex; +import io.github.dsheirer.sample.complex.Complex; public class ArcTangent { diff --git a/src/util/ColorIcon.java b/src/main/java/io/github/dsheirer/util/ColorIcon.java similarity index 93% rename from src/util/ColorIcon.java rename to src/main/java/io/github/dsheirer/util/ColorIcon.java index 85a80255..547a8967 100644 --- a/src/util/ColorIcon.java +++ b/src/main/java/io/github/dsheirer/util/ColorIcon.java @@ -15,13 +15,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package util; +package io.github.dsheirer.util; -import java.awt.Color; -import java.awt.Component; -import java.awt.Graphics; - -import javax.swing.Icon; +import javax.swing.*; +import java.awt.*; public class ColorIcon implements Icon { diff --git a/src/util/MemoryUsageLogger.java b/src/main/java/io/github/dsheirer/util/MemoryUsageLogger.java similarity index 97% rename from src/util/MemoryUsageLogger.java rename to src/main/java/io/github/dsheirer/util/MemoryUsageLogger.java index df816e9c..0c6022bf 100644 --- a/src/util/MemoryUsageLogger.java +++ b/src/main/java/io/github/dsheirer/util/MemoryUsageLogger.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package util; +package io.github.dsheirer.util; import ch.qos.logback.classic.pattern.ClassicConverter; import ch.qos.logback.classic.spi.ILoggingEvent; @@ -27,7 +27,7 @@ import org.apache.commons.io.FileUtils; * * Add the following to the logback.xml configuration file to use this custom converter: * - * + * * * Update the encoder pattern to include %memory_usage within the pattern */ diff --git a/src/util/StringUtils.java b/src/main/java/io/github/dsheirer/util/StringUtils.java similarity index 97% rename from src/util/StringUtils.java rename to src/main/java/io/github/dsheirer/util/StringUtils.java index f9f4f597..3c017810 100644 --- a/src/util/StringUtils.java +++ b/src/main/java/io/github/dsheirer/util/StringUtils.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package util; +package io.github.dsheirer.util; public class StringUtils { diff --git a/src/util/ThreadPool.java b/src/main/java/io/github/dsheirer/util/ThreadPool.java similarity index 95% rename from src/util/ThreadPool.java rename to src/main/java/io/github/dsheirer/util/ThreadPool.java index 5b8f4ebf..833533bb 100644 --- a/src/util/ThreadPool.java +++ b/src/main/java/io/github/dsheirer/util/ThreadPool.java @@ -16,9 +16,9 @@ * along with this program. If not, see * ******************************************************************************/ -package util; +package io.github.dsheirer.util; -import controller.NamingThreadFactory; +import io.github.dsheirer.controller.NamingThreadFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/util/TimeStamp.java b/src/main/java/io/github/dsheirer/util/TimeStamp.java similarity index 99% rename from src/util/TimeStamp.java rename to src/main/java/io/github/dsheirer/util/TimeStamp.java index 94314c12..f83a5ef2 100644 --- a/src/util/TimeStamp.java +++ b/src/main/java/io/github/dsheirer/util/TimeStamp.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ******************************************************************************/ -package util; +package io.github.dsheirer.util; import java.text.SimpleDateFormat; import java.util.Date; diff --git a/src/util/XTEA.java b/src/main/java/io/github/dsheirer/util/XTEA.java similarity index 99% rename from src/util/XTEA.java rename to src/main/java/io/github/dsheirer/util/XTEA.java index 9ab8c48c..921922f9 100644 --- a/src/util/XTEA.java +++ b/src/main/java/io/github/dsheirer/util/XTEA.java @@ -16,7 +16,7 @@ * along with this program. If not, see * ******************************************************************************/ -package util; +package io.github.dsheirer.util; import org.apache.commons.lang3.Validate; diff --git a/src/org/jdesktop/beans/AbstractBean.java b/src/main/java/org/jdesktop/beans/AbstractBean.java similarity index 100% rename from src/org/jdesktop/beans/AbstractBean.java rename to src/main/java/org/jdesktop/beans/AbstractBean.java diff --git a/src/org/jdesktop/beans/AbstractSerializableBean.java b/src/main/java/org/jdesktop/beans/AbstractSerializableBean.java similarity index 100% rename from src/org/jdesktop/beans/AbstractSerializableBean.java rename to src/main/java/org/jdesktop/beans/AbstractSerializableBean.java diff --git a/src/org/jdesktop/swingx/JXMapKit.form b/src/main/java/org/jdesktop/swingx/JXMapKit.form similarity index 100% rename from src/org/jdesktop/swingx/JXMapKit.form rename to src/main/java/org/jdesktop/swingx/JXMapKit.form diff --git a/src/org/jdesktop/swingx/JXMapKit.java b/src/main/java/org/jdesktop/swingx/JXMapKit.java similarity index 95% rename from src/org/jdesktop/swingx/JXMapKit.java rename to src/main/java/org/jdesktop/swingx/JXMapKit.java index da422898..6f1fa667 100644 --- a/src/org/jdesktop/swingx/JXMapKit.java +++ b/src/main/java/org/jdesktop/swingx/JXMapKit.java @@ -1,724 +1,712 @@ -/* - * JXMapKit.java - * - * Created on November 19, 2006, 3:52 AM - */ - -package org.jdesktop.swingx; - -import java.awt.Color; -import java.awt.Graphics2D; -import java.awt.Rectangle; -import java.awt.event.ActionEvent; -import java.awt.geom.Point2D; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.util.HashSet; -import java.util.Set; - -import javax.swing.AbstractAction; -import javax.swing.Action; -import javax.swing.Icon; -import javax.swing.ImageIcon; -import javax.swing.JButton; -import javax.swing.JFrame; -import javax.swing.JPanel; -import javax.swing.JSlider; -import javax.swing.SwingConstants; -import javax.swing.SwingUtilities; - -import org.jdesktop.swingx.mapviewer.DefaultTileFactory; -import org.jdesktop.swingx.mapviewer.DefaultWaypoint; -import org.jdesktop.swingx.mapviewer.GeoPosition; -import org.jdesktop.swingx.mapviewer.TileFactory; -import org.jdesktop.swingx.mapviewer.TileFactoryInfo; -import org.jdesktop.swingx.mapviewer.Waypoint; -import org.jdesktop.swingx.mapviewer.WaypointPainter; -import org.jdesktop.swingx.mapviewer.bmng.CylindricalProjectionTileFactory; -import org.jdesktop.swingx.painter.AbstractPainter; -import org.jdesktop.swingx.painter.CompoundPainter; -import org.jdesktop.swingx.painter.Painter; - -/** - *

The JXMapKit is a pair of JXMapViewers preconfigured to be easy to use - * with common features built in. This includes zoom buttons, a zoom slider, - * and a mini-map in the lower right corner showing an overview of the map. - * Each feature can be turned off using an appropriate - * isXvisible property. For example, to turn - * off the minimap call - * - *

jxMapKit.setMiniMapVisible(false);
- *

- * - *

- * The JXMapViewer is preconfigured to connect to maps.swinglabs.org which - * serves up global satellite imagery from NASA's - * Blue - * Marble NG image collection. - *

- * @author joshy - */ -public class JXMapKit extends JPanel -{ - private static final long serialVersionUID = -8366577998349912380L; - private boolean miniMapVisible = true; - private boolean zoomSliderVisible = true; - private boolean zoomButtonsVisible = true; - private final boolean sliderReversed = false; - - @SuppressWarnings("javadoc") - public enum DefaultProviders - { - SwingLabsBlueMarble, OpenStreetMaps, Custom - } - - private DefaultProviders defaultProvider = DefaultProviders.SwingLabsBlueMarble; - - private boolean addressLocationShown = true; - - private boolean dataProviderCreditShown = true; - - /** - * Creates a new JXMapKit - */ - public JXMapKit() - { - initComponents(); - setDataProviderCreditShown(false); - - zoomSlider.setOpaque(false); - try - { - Icon minusIcon = new ImageIcon(getClass().getResource("/org/jdesktop/swingx/mapviewer/resources/minus.png")); - this.zoomOutButton.setIcon(minusIcon); - this.zoomOutButton.setText(""); - Icon plusIcon = new ImageIcon(getClass().getResource("/org/jdesktop/swingx/mapviewer/resources/plus.png")); - this.zoomInButton.setIcon(plusIcon); - this.zoomInButton.setText(""); - } - catch (Throwable thr) - { - System.out.println("error: " + thr.getMessage()); - thr.printStackTrace(); - } - - setTileFactory(new CylindricalProjectionTileFactory()); - - mainMap.setCenterPosition(new GeoPosition(0, 0)); - miniMap.setCenterPosition(new GeoPosition(0, 0)); - mainMap.setRestrictOutsidePanning(true); - miniMap.setRestrictOutsidePanning(true); - - rebuildMainMapOverlay(); - - /* - * // adapter to move the minimap after the main map has moved MouseInputAdapter ma = new MouseInputAdapter() { - * public void mouseReleased(MouseEvent e) { miniMap.setCenterPosition(mapCenterPosition); } }; - * mainMap.addMouseMotionListener(ma); mainMap.addMouseListener(ma); - */ - - mainMap.addPropertyChangeListener("center", new PropertyChangeListener() - { - @Override - public void propertyChange(PropertyChangeEvent evt) - { - Point2D mapCenter = (Point2D) evt.getNewValue(); - TileFactory tf = mainMap.getTileFactory(); - GeoPosition mapPos = tf.pixelToGeo(mapCenter, mainMap.getZoom()); - miniMap.setCenterPosition(mapPos); - } - }); - - mainMap.addPropertyChangeListener("centerPosition", new PropertyChangeListener() - { - @Override - public void propertyChange(PropertyChangeEvent evt) - { - mapCenterPosition = (GeoPosition) evt.getNewValue(); - miniMap.setCenterPosition(mapCenterPosition); - Point2D pt = miniMap.getTileFactory().geoToPixel(mapCenterPosition, miniMap.getZoom()); - miniMap.setCenter(pt); - miniMap.repaint(); - } - }); - - mainMap.addPropertyChangeListener("zoom", new PropertyChangeListener() - { - @Override - public void propertyChange(PropertyChangeEvent evt) - { - zoomSlider.setValue(mainMap.getZoom()); - miniMap.setZoom(mainMap.getZoom() + 4); - } - }); - - // an overlay for the mini-map which shows a rectangle representing the main map - miniMap.setOverlayPainter(new Painter() - { - @Override - public void paint(Graphics2D g, JXMapViewer map, int width, int height) - { - // get the viewport rect of the main map - Rectangle mainMapBounds = mainMap.getViewportBounds(); - - // convert to Point2Ds - Point2D upperLeft2D = mainMapBounds.getLocation(); - Point2D lowerRight2D = new Point2D.Double(upperLeft2D.getX() + mainMapBounds.getWidth(), upperLeft2D - .getY() + mainMapBounds.getHeight()); - - // convert to GeoPostions - GeoPosition upperLeft = mainMap.getTileFactory().pixelToGeo(upperLeft2D, mainMap.getZoom()); - GeoPosition lowerRight = mainMap.getTileFactory().pixelToGeo(lowerRight2D, mainMap.getZoom()); - - // convert to Point2Ds on the mini-map - upperLeft2D = map.getTileFactory().geoToPixel(upperLeft, map.getZoom()); - lowerRight2D = map.getTileFactory().geoToPixel(lowerRight, map.getZoom()); - - g = (Graphics2D) g.create(); - Rectangle rect = map.getViewportBounds(); - // p("rect = " + rect); - g.translate(-rect.x, -rect.y); -// Point2D centerpos = map.getTileFactory().geoToPixel(mapCenterPosition, map.getZoom()); - // p("center pos = " + centerpos); - g.setPaint(Color.RED); - // g.drawRect((int)centerpos.getX()-30,(int)centerpos.getY()-30,60,60); - g.drawRect((int) upperLeft2D.getX(), (int) upperLeft2D.getY(), - (int) (lowerRight2D.getX() - upperLeft2D.getX()), - (int) (lowerRight2D.getY() - upperLeft2D.getY())); - g.setPaint(new Color(255, 0, 0, 50)); - g.fillRect((int) upperLeft2D.getX(), (int) upperLeft2D.getY(), - (int) (lowerRight2D.getX() - upperLeft2D.getX()), - (int) (lowerRight2D.getY() - upperLeft2D.getY())); - // g.drawOval((int)lowerRight2D.getX(),(int)lowerRight2D.getY(),1,1); - g.dispose(); - } - }); - - if (getDefaultProvider() == DefaultProviders.OpenStreetMaps) - { - setZoom(10); - } - else - { - setZoom(3);// joshy: hack, i shouldn't need this here - } - this.setCenterPosition(new GeoPosition(0, 0)); - } - - // private Point2D mapCenter = new Point2D.Double(0,0); - private GeoPosition mapCenterPosition = new GeoPosition(0, 0); - private boolean zoomChanging = false; - - /** - * Set the current zoomlevel for the main map. The minimap will be updated accordingly - * @param zoom the new zoom level - */ - public void setZoom(int zoom) - { - zoomChanging = true; - mainMap.setZoom(zoom); - miniMap.setZoom(mainMap.getZoom() + 4); - if (sliderReversed) - { - zoomSlider.setValue(zoomSlider.getMaximum() - zoom); - } - else - { - zoomSlider.setValue(zoom); - } - zoomChanging = false; - } - - /** - * Returns an action which can be attached to buttons or menu items to make the map zoom out - * @return a preconfigured Zoom Out action - */ - public Action getZoomOutAction() - { - Action act = new AbstractAction() - { - /** - * - */ - private static final long serialVersionUID = 5525706163434375107L; - - @Override - public void actionPerformed(ActionEvent e) - { - setZoom(mainMap.getZoom() - 1); - } - }; - act.putValue(Action.NAME, "-"); - return act; - } - - /** - * Returns an action which can be attached to buttons or menu items to make the map zoom in - * @return a preconfigured Zoom In action - */ - public Action getZoomInAction() - { - Action act = new AbstractAction() - { - /** - * - */ - private static final long serialVersionUID = 5779971489365451352L; - - @Override - public void actionPerformed(ActionEvent e) - { - setZoom(mainMap.getZoom() + 1); - } - }; - act.putValue(Action.NAME, "+"); - return act; - } - - /** - * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The - * content of this method is always regenerated by the Form Editor. - */ - // //GEN-BEGIN:initComponents - private void initComponents() - { - java.awt.GridBagConstraints gridBagConstraints; - - mainMap = new org.jdesktop.swingx.JXMapViewer(); - miniMap = new org.jdesktop.swingx.JXMapViewer(); - jPanel1 = new javax.swing.JPanel(); - zoomInButton = new javax.swing.JButton(); - zoomOutButton = new javax.swing.JButton(); - zoomSlider = new javax.swing.JSlider(); - - setLayout(new java.awt.GridBagLayout()); - - mainMap.setLayout(new java.awt.GridBagLayout()); - - miniMap.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); - miniMap.setMinimumSize(new java.awt.Dimension(100, 100)); - miniMap.setPreferredSize(new java.awt.Dimension(100, 100)); - miniMap.setLayout(new java.awt.GridBagLayout()); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 0; - gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHEAST; - gridBagConstraints.weightx = 1.0; - gridBagConstraints.weighty = 1.0; - mainMap.add(miniMap, gridBagConstraints); - - jPanel1.setOpaque(false); - jPanel1.setLayout(new java.awt.GridBagLayout()); - - zoomInButton.setAction(getZoomOutAction()); - zoomInButton.setIcon(new javax.swing.ImageIcon(getClass().getResource( - "/org/jdesktop/swingx/mapviewer/resources/plus.png"))); - zoomInButton.setMargin(new java.awt.Insets(2, 2, 2, 2)); - zoomInButton.setMaximumSize(new java.awt.Dimension(20, 20)); - zoomInButton.setMinimumSize(new java.awt.Dimension(20, 20)); - zoomInButton.setOpaque(false); - zoomInButton.setPreferredSize(new java.awt.Dimension(20, 20)); - zoomInButton.addActionListener(new java.awt.event.ActionListener() - { - @Override - public void actionPerformed(java.awt.event.ActionEvent evt) - { - zoomInButtonActionPerformed(evt); - } - }); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 1; - gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST; - gridBagConstraints.weightx = 1.0; - gridBagConstraints.weighty = 1.0; - jPanel1.add(zoomInButton, gridBagConstraints); - - zoomOutButton.setAction(getZoomInAction()); - zoomOutButton.setIcon(new javax.swing.ImageIcon(getClass().getResource( - "/org/jdesktop/swingx/mapviewer/resources/minus.png"))); - zoomOutButton.setMargin(new java.awt.Insets(2, 2, 2, 2)); - zoomOutButton.setMaximumSize(new java.awt.Dimension(20, 20)); - zoomOutButton.setMinimumSize(new java.awt.Dimension(20, 20)); - zoomOutButton.setOpaque(false); - zoomOutButton.setPreferredSize(new java.awt.Dimension(20, 20)); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 1; - gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; - gridBagConstraints.weighty = 1.0; - jPanel1.add(zoomOutButton, gridBagConstraints); - - zoomSlider.setMajorTickSpacing(1); - zoomSlider.setMaximum(15); - zoomSlider.setMinimum(10); - zoomSlider.setMinorTickSpacing(1); - zoomSlider.setOrientation(SwingConstants.VERTICAL); - zoomSlider.setPaintTicks(true); - zoomSlider.setSnapToTicks(true); - zoomSlider.setMinimumSize(new java.awt.Dimension(35, 100)); - zoomSlider.setPreferredSize(new java.awt.Dimension(35, 190)); - zoomSlider.addChangeListener(new javax.swing.event.ChangeListener() - { - @Override - public void stateChanged(javax.swing.event.ChangeEvent evt) - { - zoomSliderStateChanged(evt); - } - }); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 0; - gridBagConstraints.gridwidth = 2; - gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; - gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; - jPanel1.add(zoomSlider, gridBagConstraints); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 0; - gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHWEST; - gridBagConstraints.weightx = 1.0; - gridBagConstraints.weighty = 1.0; - gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4); - mainMap.add(jPanel1, gridBagConstraints); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - gridBagConstraints.weightx = 1.0; - gridBagConstraints.weighty = 1.0; - add(mainMap, gridBagConstraints); - }// //GEN-END:initComponents - - @SuppressWarnings("unused") - private void zoomInButtonActionPerformed(java.awt.event.ActionEvent evt) - {// GEN-FIRST:event_zoomInButtonActionPerformed - // TODO add your handling code here: - }// GEN-LAST:event_zoomInButtonActionPerformed - - @SuppressWarnings("unused") - private void zoomSliderStateChanged(javax.swing.event.ChangeEvent evt) - {// GEN-FIRST:event_zoomSliderStateChanged - if (!zoomChanging) - { - setZoom(zoomSlider.getValue()); - } - // TODO add your handling code here: - }// GEN-LAST:event_zoomSliderStateChanged - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JPanel jPanel1; - private org.jdesktop.swingx.JXMapViewer mainMap; - private org.jdesktop.swingx.JXMapViewer miniMap; - private javax.swing.JButton zoomInButton; - private javax.swing.JButton zoomOutButton; - private javax.swing.JSlider zoomSlider; - - // End of variables declaration//GEN-END:variables - - /** - * Indicates if the mini-map is currently visible - * @return the current value of the mini-map property - */ - public boolean isMiniMapVisible() - { - return miniMapVisible; - } - - /** - * Sets if the mini-map should be visible - * @param miniMapVisible a new value for the miniMap property - */ - public void setMiniMapVisible(boolean miniMapVisible) - { - boolean old = this.isMiniMapVisible(); - this.miniMapVisible = miniMapVisible; - miniMap.setVisible(miniMapVisible); - firePropertyChange("miniMapVisible", old, this.isMiniMapVisible()); - } - - /** - * Indicates if the zoom slider is currently visible - * @return the current value of the zoomSliderVisible property - */ - public boolean isZoomSliderVisible() - { - return zoomSliderVisible; - } - - /** - * Sets if the zoom slider should be visible - * @param zoomSliderVisible the new value of the zoomSliderVisible property - */ - public void setZoomSliderVisible(boolean zoomSliderVisible) - { - boolean old = this.isZoomSliderVisible(); - this.zoomSliderVisible = zoomSliderVisible; - zoomSlider.setVisible(zoomSliderVisible); - firePropertyChange("zoomSliderVisible", old, this.isZoomSliderVisible()); - } - - /** - * Indicates if the zoom buttons are visible. This is a bound property and can be listed for using a - * PropertyChangeListener - * @return current value of the zoomButtonsVisible property - */ - public boolean isZoomButtonsVisible() - { - return zoomButtonsVisible; - } - - /** - * Sets if the zoom buttons should be visible. This ia bound property. Changes can be listened for using a - * PropertyChaneListener - * @param zoomButtonsVisible new value of the zoomButtonsVisible property - */ - public void setZoomButtonsVisible(boolean zoomButtonsVisible) - { - boolean old = this.isZoomButtonsVisible(); - this.zoomButtonsVisible = zoomButtonsVisible; - zoomInButton.setVisible(zoomButtonsVisible); - zoomOutButton.setVisible(zoomButtonsVisible); - firePropertyChange("zoomButtonsVisible", old, this.isZoomButtonsVisible()); - } - - /** - * Sets the tile factory for both embedded JXMapViewer components. Calling this method will also reset the center - * and zoom levels of both maps, as well as the bounds of the zoom slider. - * @param fact the new TileFactory - */ - public void setTileFactory(TileFactory fact) - { - mainMap.setTileFactory(fact); - mainMap.setZoom(fact.getInfo().getDefaultZoomLevel()); - mainMap.setCenterPosition(new GeoPosition(0, 0)); - miniMap.setTileFactory(fact); - miniMap.setZoom(fact.getInfo().getDefaultZoomLevel() + 3); - miniMap.setCenterPosition(new GeoPosition(0, 0)); - zoomSlider.setMinimum(fact.getInfo().getMinimumZoomLevel()); - zoomSlider.setMaximum(fact.getInfo().getMaximumZoomLevel()); - } - - /** - * @param pos the new center position - */ - public void setCenterPosition(GeoPosition pos) - { - mainMap.setCenterPosition(pos); - miniMap.setCenterPosition(pos); - } - - /** - * @return the center geo position - */ - public GeoPosition getCenterPosition() - { - return mainMap.getCenterPosition(); - } - - /** - * @return the adress location - */ - public GeoPosition getAddressLocation() - { - return mainMap.getAddressLocation(); - } - - /** - * @param pos the address location - */ - public void setAddressLocation(GeoPosition pos) - { - mainMap.setAddressLocation(pos); - } - - /** - * Returns a reference to the main embedded JXMapViewer component - * @return the main map - */ - public JXMapViewer getMainMap() - { - return this.mainMap; - } - - /** - * Returns a reference to the mini embedded JXMapViewer component - * @return the minimap JXMapViewer component - */ - public JXMapViewer getMiniMap() - { - return this.miniMap; - } - - /** - * returns a reference to the zoom in button - * @return a jbutton - */ - public JButton getZoomInButton() - { - return this.zoomInButton; - } - - /** - * returns a reference to the zoom out button - * @return a jbutton - */ - public JButton getZoomOutButton() - { - return this.zoomOutButton; - } - - /** - * returns a reference to the zoom slider - * @return a jslider - */ - public JSlider getZoomSlider() - { - return this.zoomSlider; - } - - /** - * @param b the visibility flag - */ - public void setAddressLocationShown(boolean b) - { - boolean old = isAddressLocationShown(); - this.addressLocationShown = b; - addressLocationPainter.setVisible(b); - firePropertyChange("addressLocationShown", old, b); - repaint(); - } - - /** - * @return true if the address location is shown - */ - public boolean isAddressLocationShown() - { - return addressLocationShown; - } - - /** - * @param b the visibility flag - */ - public void setDataProviderCreditShown(boolean b) - { - boolean old = isDataProviderCreditShown(); - this.dataProviderCreditShown = b; - dataProviderCreditPainter.setVisible(b); - repaint(); - firePropertyChange("dataProviderCreditShown", old, b); - } - - /** - * @return true if the data provider credit is shown - */ - public boolean isDataProviderCreditShown() - { - return dataProviderCreditShown; - } - - @SuppressWarnings("unchecked") - private void rebuildMainMapOverlay() - { - CompoundPainter cp = new CompoundPainter(); - cp.setCacheable(false); - /* - * List ptrs = new ArrayList(); if(isDataProviderCreditShown()) { - * ptrs.add(dataProviderCreditPainter); } if(isAddressLocationShown()) { ptrs.add(addressLocationPainter); } - */ - cp.setPainters(dataProviderCreditPainter, addressLocationPainter); - mainMap.setOverlayPainter(cp); - } - - /** - * @param prov the default provider - */ - public void setDefaultProvider(DefaultProviders prov) - { - DefaultProviders old = this.defaultProvider; - this.defaultProvider = prov; - if (prov == DefaultProviders.SwingLabsBlueMarble) - { - setTileFactory(new CylindricalProjectionTileFactory()); - setZoom(3); - } - if (prov == DefaultProviders.OpenStreetMaps) - { - TileFactoryInfo info = new OSMTileFactoryInfo(); - TileFactory tf = new DefaultTileFactory(info); - setTileFactory(tf); - setZoom(11); - setAddressLocation(new GeoPosition(51.5, 0)); - } - firePropertyChange("defaultProvider", old, prov); - repaint(); - } - - /** - * @return the default provider - */ - public DefaultProviders getDefaultProvider() - { - return this.defaultProvider; - } - - private AbstractPainter dataProviderCreditPainter = new AbstractPainter(false) - { - @Override - protected void doPaint(Graphics2D g, JXMapViewer map, int width, int height) - { - g.setPaint(Color.WHITE); - g.drawString("data ", 50, map.getHeight() - 10); - } - }; - - private WaypointPainter addressLocationPainter = new WaypointPainter() - { - @Override - public Set getWaypoints() - { - Set set = new HashSet(); - if (getAddressLocation() != null) - { - set.add(new DefaultWaypoint(getAddressLocation())); - } - else - { - set.add(new DefaultWaypoint(0, 0)); - } - return set; - } - }; - - /** - * @param args the program args - */ - public static void main(String... args) - { - SwingUtilities.invokeLater(new Runnable() - { - @Override - public void run() - { - JXMapKit kit = new JXMapKit(); - kit.setDefaultProvider(DefaultProviders.OpenStreetMaps); - - TileFactoryInfo info = new OSMTileFactoryInfo(); - TileFactory tf = new DefaultTileFactory(info); - kit.setTileFactory(tf); - kit.setZoom(14); - kit.setAddressLocation(new GeoPosition(51.5, 0)); - kit.getMainMap().setDrawTileBorders(true); - kit.getMainMap().setRestrictOutsidePanning(true); - kit.getMainMap().setHorizontalWrapped(false); - - ((DefaultTileFactory) kit.getMainMap().getTileFactory()).setThreadPoolSize(8); - JFrame frame = new JFrame("JXMapKit test"); - frame.add(kit); - frame.pack(); - frame.setSize(500, 300); - frame.setVisible(true); - } - }); - } -} +/* + * JXMapKit.java + * + * Created on November 19, 2006, 3:52 AM + */ + +package org.jdesktop.swingx; + +import org.jdesktop.swingx.mapviewer.DefaultTileFactory; +import org.jdesktop.swingx.mapviewer.DefaultWaypoint; +import org.jdesktop.swingx.mapviewer.GeoPosition; +import org.jdesktop.swingx.mapviewer.TileFactory; +import org.jdesktop.swingx.mapviewer.TileFactoryInfo; +import org.jdesktop.swingx.mapviewer.Waypoint; +import org.jdesktop.swingx.mapviewer.WaypointPainter; +import org.jdesktop.swingx.mapviewer.bmng.CylindricalProjectionTileFactory; +import org.jdesktop.swingx.painter.AbstractPainter; +import org.jdesktop.swingx.painter.CompoundPainter; +import org.jdesktop.swingx.painter.Painter; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.geom.Point2D; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.util.HashSet; +import java.util.Set; + +/** + *

The JXMapKit is a pair of JXMapViewers preconfigured to be easy to use + * with common features built in. This includes zoom buttons, a zoom slider, + * and a mini-map in the lower right corner showing an overview of the map. + * Each feature can be turned off using an appropriate + * isXvisible property. For example, to turn + * off the minimap call + * + *

jxMapKit.setMiniMapVisible(false);
+ *

+ * + *

+ * The JXMapViewer is preconfigured to connect to maps.swinglabs.org which + * serves up global satellite imagery from NASA's + * Blue + * Marble NG image collection. + *

+ * @author joshy + */ +public class JXMapKit extends JPanel +{ + private static final long serialVersionUID = -8366577998349912380L; + private boolean miniMapVisible = true; + private boolean zoomSliderVisible = true; + private boolean zoomButtonsVisible = true; + private final boolean sliderReversed = false; + + @SuppressWarnings("javadoc") + public enum DefaultProviders + { + SwingLabsBlueMarble, OpenStreetMaps, Custom + } + + private DefaultProviders defaultProvider = DefaultProviders.SwingLabsBlueMarble; + + private boolean addressLocationShown = true; + + private boolean dataProviderCreditShown = true; + + /** + * Creates a new JXMapKit + */ + public JXMapKit() + { + initComponents(); + setDataProviderCreditShown(false); + + zoomSlider.setOpaque(false); + try + { + Icon minusIcon = new ImageIcon(getClass().getResource("/org/jdesktop/swingx/mapviewer/resources/minus.png")); + this.zoomOutButton.setIcon(minusIcon); + this.zoomOutButton.setText(""); + Icon plusIcon = new ImageIcon(getClass().getResource("/org/jdesktop/swingx/mapviewer/resources/plus.png")); + this.zoomInButton.setIcon(plusIcon); + this.zoomInButton.setText(""); + } + catch (Throwable thr) + { + System.out.println("error: " + thr.getMessage()); + thr.printStackTrace(); + } + + setTileFactory(new CylindricalProjectionTileFactory()); + + mainMap.setCenterPosition(new GeoPosition(0, 0)); + miniMap.setCenterPosition(new GeoPosition(0, 0)); + mainMap.setRestrictOutsidePanning(true); + miniMap.setRestrictOutsidePanning(true); + + rebuildMainMapOverlay(); + + /* + * // adapter to move the minimap after the main map has moved MouseInputAdapter ma = new MouseInputAdapter() { + * public void mouseReleased(MouseEvent e) { miniMap.setCenterPosition(mapCenterPosition); } }; + * mainMap.addMouseMotionListener(ma); mainMap.addMouseListener(ma); + */ + + mainMap.addPropertyChangeListener("center", new PropertyChangeListener() + { + @Override + public void propertyChange(PropertyChangeEvent evt) + { + Point2D mapCenter = (Point2D) evt.getNewValue(); + TileFactory tf = mainMap.getTileFactory(); + GeoPosition mapPos = tf.pixelToGeo(mapCenter, mainMap.getZoom()); + miniMap.setCenterPosition(mapPos); + } + }); + + mainMap.addPropertyChangeListener("centerPosition", new PropertyChangeListener() + { + @Override + public void propertyChange(PropertyChangeEvent evt) + { + mapCenterPosition = (GeoPosition) evt.getNewValue(); + miniMap.setCenterPosition(mapCenterPosition); + Point2D pt = miniMap.getTileFactory().geoToPixel(mapCenterPosition, miniMap.getZoom()); + miniMap.setCenter(pt); + miniMap.repaint(); + } + }); + + mainMap.addPropertyChangeListener("zoom", new PropertyChangeListener() + { + @Override + public void propertyChange(PropertyChangeEvent evt) + { + zoomSlider.setValue(mainMap.getZoom()); + miniMap.setZoom(mainMap.getZoom() + 4); + } + }); + + // an overlay for the mini-map which shows a rectangle representing the main map + miniMap.setOverlayPainter(new Painter() + { + @Override + public void paint(Graphics2D g, JXMapViewer map, int width, int height) + { + // get the viewport rect of the main map + Rectangle mainMapBounds = mainMap.getViewportBounds(); + + // convert to Point2Ds + Point2D upperLeft2D = mainMapBounds.getLocation(); + Point2D lowerRight2D = new Point2D.Double(upperLeft2D.getX() + mainMapBounds.getWidth(), upperLeft2D + .getY() + mainMapBounds.getHeight()); + + // convert to GeoPostions + GeoPosition upperLeft = mainMap.getTileFactory().pixelToGeo(upperLeft2D, mainMap.getZoom()); + GeoPosition lowerRight = mainMap.getTileFactory().pixelToGeo(lowerRight2D, mainMap.getZoom()); + + // convert to Point2Ds on the mini-map + upperLeft2D = map.getTileFactory().geoToPixel(upperLeft, map.getZoom()); + lowerRight2D = map.getTileFactory().geoToPixel(lowerRight, map.getZoom()); + + g = (Graphics2D) g.create(); + Rectangle rect = map.getViewportBounds(); + // p("rect = " + rect); + g.translate(-rect.x, -rect.y); +// Point2D centerpos = map.getTileFactory().geoToPixel(mapCenterPosition, map.getZoom()); + // p("center pos = " + centerpos); + g.setPaint(Color.RED); + // g.drawRect((int)centerpos.getX()-30,(int)centerpos.getY()-30,60,60); + g.drawRect((int) upperLeft2D.getX(), (int) upperLeft2D.getY(), + (int) (lowerRight2D.getX() - upperLeft2D.getX()), + (int) (lowerRight2D.getY() - upperLeft2D.getY())); + g.setPaint(new Color(255, 0, 0, 50)); + g.fillRect((int) upperLeft2D.getX(), (int) upperLeft2D.getY(), + (int) (lowerRight2D.getX() - upperLeft2D.getX()), + (int) (lowerRight2D.getY() - upperLeft2D.getY())); + // g.drawOval((int)lowerRight2D.getX(),(int)lowerRight2D.getY(),1,1); + g.dispose(); + } + }); + + if (getDefaultProvider() == DefaultProviders.OpenStreetMaps) + { + setZoom(10); + } + else + { + setZoom(3);// joshy: hack, i shouldn't need this here + } + this.setCenterPosition(new GeoPosition(0, 0)); + } + + // private Point2D mapCenter = new Point2D.Double(0,0); + private GeoPosition mapCenterPosition = new GeoPosition(0, 0); + private boolean zoomChanging = false; + + /** + * Set the current zoomlevel for the main map. The minimap will be updated accordingly + * @param zoom the new zoom level + */ + public void setZoom(int zoom) + { + zoomChanging = true; + mainMap.setZoom(zoom); + miniMap.setZoom(mainMap.getZoom() + 4); + if (sliderReversed) + { + zoomSlider.setValue(zoomSlider.getMaximum() - zoom); + } + else + { + zoomSlider.setValue(zoom); + } + zoomChanging = false; + } + + /** + * Returns an action which can be attached to buttons or menu items to make the map zoom out + * @return a preconfigured Zoom Out action + */ + public Action getZoomOutAction() + { + Action act = new AbstractAction() + { + /** + * + */ + private static final long serialVersionUID = 5525706163434375107L; + + @Override + public void actionPerformed(ActionEvent e) + { + setZoom(mainMap.getZoom() - 1); + } + }; + act.putValue(Action.NAME, "-"); + return act; + } + + /** + * Returns an action which can be attached to buttons or menu items to make the map zoom in + * @return a preconfigured Zoom In action + */ + public Action getZoomInAction() + { + Action act = new AbstractAction() + { + /** + * + */ + private static final long serialVersionUID = 5779971489365451352L; + + @Override + public void actionPerformed(ActionEvent e) + { + setZoom(mainMap.getZoom() + 1); + } + }; + act.putValue(Action.NAME, "+"); + return act; + } + + /** + * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The + * content of this method is always regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() + { + java.awt.GridBagConstraints gridBagConstraints; + + mainMap = new org.jdesktop.swingx.JXMapViewer(); + miniMap = new org.jdesktop.swingx.JXMapViewer(); + jPanel1 = new javax.swing.JPanel(); + zoomInButton = new javax.swing.JButton(); + zoomOutButton = new javax.swing.JButton(); + zoomSlider = new javax.swing.JSlider(); + + setLayout(new java.awt.GridBagLayout()); + + mainMap.setLayout(new java.awt.GridBagLayout()); + + miniMap.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + miniMap.setMinimumSize(new java.awt.Dimension(100, 100)); + miniMap.setPreferredSize(new java.awt.Dimension(100, 100)); + miniMap.setLayout(new java.awt.GridBagLayout()); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 0; + gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHEAST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.weighty = 1.0; + mainMap.add(miniMap, gridBagConstraints); + + jPanel1.setOpaque(false); + jPanel1.setLayout(new java.awt.GridBagLayout()); + + zoomInButton.setAction(getZoomOutAction()); + zoomInButton.setIcon(new javax.swing.ImageIcon(getClass().getResource( + "/org/jdesktop/swingx/mapviewer/resources/plus.png"))); + zoomInButton.setMargin(new java.awt.Insets(2, 2, 2, 2)); + zoomInButton.setMaximumSize(new java.awt.Dimension(20, 20)); + zoomInButton.setMinimumSize(new java.awt.Dimension(20, 20)); + zoomInButton.setOpaque(false); + zoomInButton.setPreferredSize(new java.awt.Dimension(20, 20)); + zoomInButton.addActionListener(new java.awt.event.ActionListener() + { + @Override + public void actionPerformed(java.awt.event.ActionEvent evt) + { + zoomInButtonActionPerformed(evt); + } + }); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 1; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.weighty = 1.0; + jPanel1.add(zoomInButton, gridBagConstraints); + + zoomOutButton.setAction(getZoomInAction()); + zoomOutButton.setIcon(new javax.swing.ImageIcon(getClass().getResource( + "/org/jdesktop/swingx/mapviewer/resources/minus.png"))); + zoomOutButton.setMargin(new java.awt.Insets(2, 2, 2, 2)); + zoomOutButton.setMaximumSize(new java.awt.Dimension(20, 20)); + zoomOutButton.setMinimumSize(new java.awt.Dimension(20, 20)); + zoomOutButton.setOpaque(false); + zoomOutButton.setPreferredSize(new java.awt.Dimension(20, 20)); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 1; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weighty = 1.0; + jPanel1.add(zoomOutButton, gridBagConstraints); + + zoomSlider.setMajorTickSpacing(1); + zoomSlider.setMaximum(15); + zoomSlider.setMinimum(10); + zoomSlider.setMinorTickSpacing(1); + zoomSlider.setOrientation(SwingConstants.VERTICAL); + zoomSlider.setPaintTicks(true); + zoomSlider.setSnapToTicks(true); + zoomSlider.setMinimumSize(new java.awt.Dimension(35, 100)); + zoomSlider.setPreferredSize(new java.awt.Dimension(35, 190)); + zoomSlider.addChangeListener(new javax.swing.event.ChangeListener() + { + @Override + public void stateChanged(javax.swing.event.ChangeEvent evt) + { + zoomSliderStateChanged(evt); + } + }); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 0; + gridBagConstraints.gridwidth = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; + jPanel1.add(zoomSlider, gridBagConstraints); + + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 0; + gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHWEST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.weighty = 1.0; + gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4); + mainMap.add(jPanel1, gridBagConstraints); + + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.weighty = 1.0; + add(mainMap, gridBagConstraints); + }// //GEN-END:initComponents + + @SuppressWarnings("unused") + private void zoomInButtonActionPerformed(java.awt.event.ActionEvent evt) + {// GEN-FIRST:event_zoomInButtonActionPerformed + // TODO add your handling code here: + }// GEN-LAST:event_zoomInButtonActionPerformed + + @SuppressWarnings("unused") + private void zoomSliderStateChanged(javax.swing.event.ChangeEvent evt) + {// GEN-FIRST:event_zoomSliderStateChanged + if (!zoomChanging) + { + setZoom(zoomSlider.getValue()); + } + // TODO add your handling code here: + }// GEN-LAST:event_zoomSliderStateChanged + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JPanel jPanel1; + private org.jdesktop.swingx.JXMapViewer mainMap; + private org.jdesktop.swingx.JXMapViewer miniMap; + private javax.swing.JButton zoomInButton; + private javax.swing.JButton zoomOutButton; + private javax.swing.JSlider zoomSlider; + + // End of variables declaration//GEN-END:variables + + /** + * Indicates if the mini-map is currently visible + * @return the current value of the mini-map property + */ + public boolean isMiniMapVisible() + { + return miniMapVisible; + } + + /** + * Sets if the mini-map should be visible + * @param miniMapVisible a new value for the miniMap property + */ + public void setMiniMapVisible(boolean miniMapVisible) + { + boolean old = this.isMiniMapVisible(); + this.miniMapVisible = miniMapVisible; + miniMap.setVisible(miniMapVisible); + firePropertyChange("miniMapVisible", old, this.isMiniMapVisible()); + } + + /** + * Indicates if the zoom slider is currently visible + * @return the current value of the zoomSliderVisible property + */ + public boolean isZoomSliderVisible() + { + return zoomSliderVisible; + } + + /** + * Sets if the zoom slider should be visible + * @param zoomSliderVisible the new value of the zoomSliderVisible property + */ + public void setZoomSliderVisible(boolean zoomSliderVisible) + { + boolean old = this.isZoomSliderVisible(); + this.zoomSliderVisible = zoomSliderVisible; + zoomSlider.setVisible(zoomSliderVisible); + firePropertyChange("zoomSliderVisible", old, this.isZoomSliderVisible()); + } + + /** + * Indicates if the zoom buttons are visible. This is a bound property and can be listed for using a + * PropertyChangeListener + * @return current value of the zoomButtonsVisible property + */ + public boolean isZoomButtonsVisible() + { + return zoomButtonsVisible; + } + + /** + * Sets if the zoom buttons should be visible. This ia bound property. Changes can be listened for using a + * PropertyChaneListener + * @param zoomButtonsVisible new value of the zoomButtonsVisible property + */ + public void setZoomButtonsVisible(boolean zoomButtonsVisible) + { + boolean old = this.isZoomButtonsVisible(); + this.zoomButtonsVisible = zoomButtonsVisible; + zoomInButton.setVisible(zoomButtonsVisible); + zoomOutButton.setVisible(zoomButtonsVisible); + firePropertyChange("zoomButtonsVisible", old, this.isZoomButtonsVisible()); + } + + /** + * Sets the tile factory for both embedded JXMapViewer components. Calling this method will also reset the center + * and zoom levels of both maps, as well as the bounds of the zoom slider. + * @param fact the new TileFactory + */ + public void setTileFactory(TileFactory fact) + { + mainMap.setTileFactory(fact); + mainMap.setZoom(fact.getInfo().getDefaultZoomLevel()); + mainMap.setCenterPosition(new GeoPosition(0, 0)); + miniMap.setTileFactory(fact); + miniMap.setZoom(fact.getInfo().getDefaultZoomLevel() + 3); + miniMap.setCenterPosition(new GeoPosition(0, 0)); + zoomSlider.setMinimum(fact.getInfo().getMinimumZoomLevel()); + zoomSlider.setMaximum(fact.getInfo().getMaximumZoomLevel()); + } + + /** + * @param pos the new center position + */ + public void setCenterPosition(GeoPosition pos) + { + mainMap.setCenterPosition(pos); + miniMap.setCenterPosition(pos); + } + + /** + * @return the center geo position + */ + public GeoPosition getCenterPosition() + { + return mainMap.getCenterPosition(); + } + + /** + * @return the adress location + */ + public GeoPosition getAddressLocation() + { + return mainMap.getAddressLocation(); + } + + /** + * @param pos the address location + */ + public void setAddressLocation(GeoPosition pos) + { + mainMap.setAddressLocation(pos); + } + + /** + * Returns a reference to the main embedded JXMapViewer component + * @return the main map + */ + public JXMapViewer getMainMap() + { + return this.mainMap; + } + + /** + * Returns a reference to the mini embedded JXMapViewer component + * @return the minimap JXMapViewer component + */ + public JXMapViewer getMiniMap() + { + return this.miniMap; + } + + /** + * returns a reference to the zoom in button + * @return a jbutton + */ + public JButton getZoomInButton() + { + return this.zoomInButton; + } + + /** + * returns a reference to the zoom out button + * @return a jbutton + */ + public JButton getZoomOutButton() + { + return this.zoomOutButton; + } + + /** + * returns a reference to the zoom slider + * @return a jslider + */ + public JSlider getZoomSlider() + { + return this.zoomSlider; + } + + /** + * @param b the visibility flag + */ + public void setAddressLocationShown(boolean b) + { + boolean old = isAddressLocationShown(); + this.addressLocationShown = b; + addressLocationPainter.setVisible(b); + firePropertyChange("addressLocationShown", old, b); + repaint(); + } + + /** + * @return true if the address location is shown + */ + public boolean isAddressLocationShown() + { + return addressLocationShown; + } + + /** + * @param b the visibility flag + */ + public void setDataProviderCreditShown(boolean b) + { + boolean old = isDataProviderCreditShown(); + this.dataProviderCreditShown = b; + dataProviderCreditPainter.setVisible(b); + repaint(); + firePropertyChange("dataProviderCreditShown", old, b); + } + + /** + * @return true if the data provider credit is shown + */ + public boolean isDataProviderCreditShown() + { + return dataProviderCreditShown; + } + + @SuppressWarnings("unchecked") + private void rebuildMainMapOverlay() + { + CompoundPainter cp = new CompoundPainter(); + cp.setCacheable(false); + /* + * List ptrs = new ArrayList(); if(isDataProviderCreditShown()) { + * ptrs.add(dataProviderCreditPainter); } if(isAddressLocationShown()) { ptrs.add(addressLocationPainter); } + */ + cp.setPainters(dataProviderCreditPainter, addressLocationPainter); + mainMap.setOverlayPainter(cp); + } + + /** + * @param prov the default provider + */ + public void setDefaultProvider(DefaultProviders prov) + { + DefaultProviders old = this.defaultProvider; + this.defaultProvider = prov; + if (prov == DefaultProviders.SwingLabsBlueMarble) + { + setTileFactory(new CylindricalProjectionTileFactory()); + setZoom(3); + } + if (prov == DefaultProviders.OpenStreetMaps) + { + TileFactoryInfo info = new OSMTileFactoryInfo(); + TileFactory tf = new DefaultTileFactory(info); + setTileFactory(tf); + setZoom(11); + setAddressLocation(new GeoPosition(51.5, 0)); + } + firePropertyChange("defaultProvider", old, prov); + repaint(); + } + + /** + * @return the default provider + */ + public DefaultProviders getDefaultProvider() + { + return this.defaultProvider; + } + + private AbstractPainter dataProviderCreditPainter = new AbstractPainter(false) + { + @Override + protected void doPaint(Graphics2D g, JXMapViewer map, int width, int height) + { + g.setPaint(Color.WHITE); + g.drawString("data ", 50, map.getHeight() - 10); + } + }; + + private WaypointPainter addressLocationPainter = new WaypointPainter() + { + @Override + public Set getWaypoints() + { + Set set = new HashSet(); + if (getAddressLocation() != null) + { + set.add(new DefaultWaypoint(getAddressLocation())); + } + else + { + set.add(new DefaultWaypoint(0, 0)); + } + return set; + } + }; + + /** + * @param args the program args + */ + public static void main(String... args) + { + SwingUtilities.invokeLater(new Runnable() + { + @Override + public void run() + { + JXMapKit kit = new JXMapKit(); + kit.setDefaultProvider(DefaultProviders.OpenStreetMaps); + + TileFactoryInfo info = new OSMTileFactoryInfo(); + TileFactory tf = new DefaultTileFactory(info); + kit.setTileFactory(tf); + kit.setZoom(14); + kit.setAddressLocation(new GeoPosition(51.5, 0)); + kit.getMainMap().setDrawTileBorders(true); + kit.getMainMap().setRestrictOutsidePanning(true); + kit.getMainMap().setHorizontalWrapped(false); + + ((DefaultTileFactory) kit.getMainMap().getTileFactory()).setThreadPoolSize(8); + JFrame frame = new JFrame("JXMapKit test"); + frame.add(kit); + frame.pack(); + frame.setSize(500, 300); + frame.setVisible(true); + } + }); + } +} diff --git a/src/org/jdesktop/swingx/JXMapViewer.java b/src/main/java/org/jdesktop/swingx/JXMapViewer.java similarity index 95% rename from src/org/jdesktop/swingx/JXMapViewer.java rename to src/main/java/org/jdesktop/swingx/JXMapViewer.java index 8c999c07..d7b05e0e 100644 --- a/src/org/jdesktop/swingx/JXMapViewer.java +++ b/src/main/java/org/jdesktop/swingx/JXMapViewer.java @@ -1,787 +1,779 @@ -/* - * MapViewer.java - * - * Created on March 14, 2006, 2:14 PM - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package org.jdesktop.swingx; - -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Image; -import java.awt.Insets; -import java.awt.Rectangle; -import java.awt.geom.Point2D; -import java.awt.geom.Rectangle2D; -import java.awt.image.BufferedImage; -import java.beans.DesignMode; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.util.Set; - -import javax.swing.ImageIcon; -import javax.swing.JPanel; - -import org.jdesktop.swingx.mapviewer.GeoPosition; -import org.jdesktop.swingx.mapviewer.Tile; -import org.jdesktop.swingx.mapviewer.TileFactory; -import org.jdesktop.swingx.mapviewer.TileFactoryInfo; -import org.jdesktop.swingx.mapviewer.TileListener; -import org.jdesktop.swingx.mapviewer.empty.EmptyTileFactory; -import org.jdesktop.swingx.painter.AbstractPainter; -import org.jdesktop.swingx.painter.Painter; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * A tile oriented map component that can easily be used with tile sources - * on the web like Google and Yahoo maps, satellite data such as NASA imagery, - * and also with file based sources like pre-processed NASA images. - * A known map provider can be used with the SLMapServerInfo, - * which will connect to a 2km resolution version of NASA's Blue Marble Next Generation - * imagery. @see SLMapServerInfo for more information. - * - * Note, the JXMapViewer has three center point properties. The addressLocation property - * represents an abstract center of the map. This would usually be something like the first item - * in a search result. It is a {@link GeoPosition}. The centerPosition property represents - * the current center point of the map. If the user pans the map then the centerPosition point will - * change but the addressLocation will not. Calling recenterToAddressLocation() will move the map - * back to that center address. The center property represents the same point as the centerPosition - * property, but as a Point2D in pixel space instead of a GeoPosition in lat/long space. Note that - * the center property is a Point2D in the entire world bitmap, not in the portion of the map currently - * visible. You can use the getViewportBounds() method to find the portion of the map currently visible - * and adjust your calculations accordingly. Changing the center property will change the centerPosition - * property and vice versa. All three properties are bound. - * @author Joshua.Marinacci@sun.com - * @see org.jdesktop.swingx.mapviewer.bmng.SLMapServerInfo - */ -public class JXMapViewer extends JPanel implements DesignMode -{ - private static final long serialVersionUID = -3530746298586937321L; - - private final static Logger mLog = - LoggerFactory.getLogger( JXMapViewer.class ); - - private final boolean isNegativeYAllowed = true; // maybe rename to isNorthBounded and isSouthBounded? - - /** - * The zoom level. Generally a value between 1 and 15 (TODO Is this true for all the mapping worlds? What does this - * mean if some mapping system doesn't support the zoom level? - */ - private int zoomLevel = 1; - - /** - * The position, in map coordinates of the center point. This is defined as the distance from the top and - * left edges of the map in pixels. Dragging the map component will change the center position. Zooming in/out will - * cause the center to be recalculated so as to remain in the center of the new "map". - */ - private Point2D center = new Point2D.Double(0, 0); - - /** - * Indicates whether or not to draw the borders between tiles. Defaults to false. TODO Generally not very nice - * looking, very much a product of testing Consider whether this should really be a property or not. - */ - private boolean drawTileBorders = false; - - /** - * Factory used by this component to grab the tiles necessary for painting the map. - */ - private TileFactory factory; - - /** - * The position in latitude/longitude of the "address" being mapped. This is a special coordinate that, when moved, - * will cause the map to be moved as well. It is separate from "center" in that "center" tracks the current center - * (in pixels) of the viewport whereas this will not change when panning or zooming. Whenever the addressLocation is - * changed, however, the map will be repositioned. - */ - private GeoPosition addressLocation; - - /** - * The overlay to delegate to for painting the "foreground" of the map component. This would include painting - * waypoints, day/night, etc. Also receives mouse events. - */ - private Painter overlay; - - private boolean designTime; - - private Image loadingImage; - - private boolean restrictOutsidePanning = true; - private boolean horizontalWrapped = true; - - /** - * Create a new JXMapViewer. By default it will use the EmptyTileFactory - */ - public JXMapViewer() - { - factory = new EmptyTileFactory(); - // setTileFactory(new GoogleTileFactory()); - - // make a dummy loading image - try - { - ImageIcon imageIcon = new ImageIcon( "images/loading.png" ); - this.setLoadingImage( imageIcon.getImage() ); - } - catch (Throwable ex) - { - - mLog.error( "JXMapViewer could not load 'loading.png'" ); - - BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB); - Graphics2D g2 = img.createGraphics(); - g2.setColor(Color.black); - g2.fillRect(0, 0, 16, 16); - g2.dispose(); - this.setLoadingImage(img); - } - - // setAddressLocation(new GeoPosition(37.392137,-121.950431)); // Sun campus - } - - @Override - protected void paintComponent(Graphics g) - { - super.paintComponent(g); - - doPaintComponent(g); - } - - // the method that does the actual painting - private void doPaintComponent(Graphics g) - {/* - * if (isOpaque() || isDesignTime()) { g.setColor(getBackground()); g.fillRect(0,0,getWidth(),getHeight()); } - */ - - if (isDesignTime()) - { - // do nothing - } - else - { - int z = getZoom(); - Rectangle viewportBounds = getViewportBounds(); - drawMapTiles(g, z, viewportBounds); - drawOverlays(z, g, viewportBounds); - } - - super.paintBorder(g); - } - - /** - * Indicate that the component is being used at design time, such as in a visual editor like NetBeans' Matisse - * @param b indicates if the component is being used at design time - */ - @Override - public void setDesignTime(boolean b) - { - this.designTime = b; - } - - /** - * Indicates whether the component is being used at design time, such as in a visual editor like NetBeans' Matisse - * @return boolean indicating if the component is being used at design time - */ - @Override - public boolean isDesignTime() - { - return designTime; - } - - /** - * Draw the map tiles. This method is for implementation use only. - * @param g Graphics - * @param zoom zoom level to draw at - * @param viewportBounds the bounds to draw within - */ - protected void drawMapTiles(final Graphics g, final int zoom, Rectangle viewportBounds) - { - int size = getTileFactory().getTileSize(zoom); - Dimension mapSize = getTileFactory().getMapSize(zoom); - - // calculate the "visible" viewport area in tiles - int numWide = viewportBounds.width / size + 2; - int numHigh = viewportBounds.height / size + 2; - - // TilePoint topLeftTile = getTileFactory().getTileCoordinate( - // new Point2D.Double(viewportBounds.x, viewportBounds.y)); - TileFactoryInfo info = getTileFactory().getInfo(); - int tpx = (int) Math.floor(viewportBounds.getX() / info.getTileSize(0)); - int tpy = (int) Math.floor(viewportBounds.getY() / info.getTileSize(0)); - // TilePoint topLeftTile = new TilePoint(tpx, tpy); - - // p("top tile = " + topLeftTile); - // fetch the tiles from the factory and store them in the tiles cache - // attach the tileLoadListener - for (int x = 0; x <= numWide; x++) - { - for (int y = 0; y <= numHigh; y++) - { - int itpx = x + tpx;// topLeftTile.getX(); - int itpy = y + tpy;// topLeftTile.getY(); - // TilePoint point = new TilePoint(x + topLeftTile.getX(), y + topLeftTile.getY()); - // only proceed if the specified tile point lies within the area being painted - if (g.getClipBounds().intersects( - new Rectangle(itpx * size - viewportBounds.x, itpy * size - viewportBounds.y, size, size))) - { - Tile tile = getTileFactory().getTile(itpx, itpy, zoom); - int ox = ((itpx * getTileFactory().getTileSize(zoom)) - viewportBounds.x); - int oy = ((itpy * getTileFactory().getTileSize(zoom)) - viewportBounds.y); - - // if the tile is off the map to the north/south, then just don't paint anything - if (isTileOnMap(itpx, itpy, mapSize)) - { - if (isOpaque()) - { - g.setColor(getBackground()); - g.fillRect(ox, oy, size, size); - } - } - else if (tile.isLoaded()) - { - g.drawImage(tile.getImage(), ox, oy, null); - } - else - { - // Use tile at higher zoom level with 200% magnification - Tile superTile = getTileFactory().getTile(itpx / 2, itpy / 2, zoom + 1); - - if (superTile.isLoaded()) - { - int offX = (itpx % 2) * size / 2; - int offY = (itpy % 2) * size / 2; - g.drawImage(superTile.getImage(), ox, oy, ox + size, oy + size, offX, offY, offX + size / 2, offY + size / 2, null); - } - else - { - int imageX = (getTileFactory().getTileSize(zoom) - getLoadingImage().getWidth(null)) / 2; - int imageY = (getTileFactory().getTileSize(zoom) - getLoadingImage().getHeight(null)) / 2; - g.setColor(Color.GRAY); - g.fillRect(ox, oy, size, size); - g.drawImage(getLoadingImage(), ox + imageX, oy + imageY, null); - } - } - if (isDrawTileBorders()) - { - - g.setColor(Color.black); - g.drawRect(ox, oy, size, size); - g.drawRect(ox + size / 2 - 5, oy + size / 2 - 5, 10, 10); - g.setColor(Color.white); - g.drawRect(ox + 1, oy + 1, size, size); - - String text = itpx + ", " + itpy + ", " + getZoom(); - g.setColor(Color.BLACK); - g.drawString(text, ox + 10, oy + 30); - g.drawString(text, ox + 10 + 2, oy + 30 + 2); - g.setColor(Color.WHITE); - g.drawString(text, ox + 10 + 1, oy + 30 + 1); - } - } - } - } - } - - @SuppressWarnings("unused") - private void drawOverlays(final int zoom, final Graphics g, final Rectangle viewportBounds) - { - if (overlay != null) - { - overlay.paint((Graphics2D) g, this, getWidth(), getHeight()); - } - } - - @SuppressWarnings("unused") - private boolean isTileOnMap(int x, int y, Dimension mapSize) - { - return !isNegativeYAllowed && y < 0 || y >= mapSize.getHeight(); - } - - /** - * Sets the map overlay. This is a Painter which will paint on top of the map. It can be used to draw waypoints, - * lines, or static overlays like text messages. - * @param overlay the map overlay to use - */ - public void setOverlayPainter(Painter overlay) - { - Painter old = getOverlayPainter(); - this.overlay = overlay; - - PropertyChangeListener listener = new PropertyChangeListener() - { - @Override - public void propertyChange(PropertyChangeEvent evt) - { - if (evt.getNewValue().equals(Boolean.TRUE)) - { - repaint(); - } - } - }; - - if (old instanceof AbstractPainter) - { - AbstractPainter ap = (AbstractPainter) overlay; - ap.removePropertyChangeListener("dirty", listener); - } - - if (overlay instanceof AbstractPainter) - { - AbstractPainter ap = (AbstractPainter) overlay; - ap.addPropertyChangeListener("dirty", listener); - } - - firePropertyChange("mapOverlay", old, getOverlayPainter()); - repaint(); - } - - /** - * Gets the current map overlay - * @return the current map overlay - */ - public Painter getOverlayPainter() - { - return overlay; - } - - /** - * Returns the bounds of the viewport in pixels. This can be used to transform points into the world bitmap - * coordinate space. - * @return the bounds in pixels of the "view" of this map - */ - public Rectangle getViewportBounds() - { - return calculateViewportBounds(getCenter()); - } - - private Rectangle calculateViewportBounds(Point2D centr) - { - Insets insets = getInsets(); - // calculate the "visible" viewport area in pixels - int viewportWidth = getWidth() - insets.left - insets.right; - int viewportHeight = getHeight() - insets.top - insets.bottom; - double viewportX = (centr.getX() - viewportWidth / 2); - double viewportY = (centr.getY() - viewportHeight / 2); - return new Rectangle((int) viewportX, (int) viewportY, viewportWidth, viewportHeight); - } - - /** - * Set the current zoom level - * @param zoom the new zoom level - */ - public void setZoom(int zoom) - { - if (zoom == this.zoomLevel) - { - return; - } - - TileFactoryInfo info = getTileFactory().getInfo(); - // don't repaint if we are out of the valid zoom levels - if (info != null && (zoom < info.getMinimumZoomLevel() || zoom > info.getMaximumZoomLevel())) - { - return; - } - - // if(zoom >= 0 && zoom <= 15 && zoom != this.zoom) { - int oldzoom = this.zoomLevel; - Point2D oldCenter = getCenter(); - Dimension oldMapSize = getTileFactory().getMapSize(oldzoom); - this.zoomLevel = zoom; - this.firePropertyChange("zoom", oldzoom, zoom); - - Dimension mapSize = getTileFactory().getMapSize(zoom); - - setCenter(new Point2D.Double(oldCenter.getX() * (mapSize.getWidth() / oldMapSize.getWidth()), oldCenter.getY() - * (mapSize.getHeight() / oldMapSize.getHeight()))); - - repaint(); - } - - /** - * Gets the current zoom level - * @return the current zoom level - */ - public int getZoom() - { - return this.zoomLevel; - } - - /** - * Gets the current address location of the map. This property does not change when the user pans the map. This - * property is bound. - * @return the current map location (address) - */ - public GeoPosition getAddressLocation() - { - return addressLocation; - } - - /** - * Gets the current address location of the map - * @param addressLocation the new address location - */ - public void setAddressLocation(GeoPosition addressLocation) - { - GeoPosition old = getAddressLocation(); - this.addressLocation = addressLocation; - setCenter(getTileFactory().geoToPixel(addressLocation, getZoom())); - - firePropertyChange("addressLocation", old, getAddressLocation()); - repaint(); - } - - /** - * Re-centers the map to have the current address location be at the center of the map, accounting for the map's - * width and height. - */ - public void recenterToAddressLocation() - { - setCenter(getTileFactory().geoToPixel(getAddressLocation(), getZoom())); - repaint(); - } - - /** - * Indicates if the tile borders should be drawn. Mainly used for debugging. - * @return the value of this property - */ - public boolean isDrawTileBorders() - { - return drawTileBorders; - } - - /** - * Set if the tile borders should be drawn. Mainly used for debugging. - * @param drawTileBorders new value of this drawTileBorders - */ - public void setDrawTileBorders(boolean drawTileBorders) - { - boolean old = isDrawTileBorders(); - this.drawTileBorders = drawTileBorders; - firePropertyChange("drawTileBorders", old, isDrawTileBorders()); - repaint(); - } - - /** - * A property indicating the center position of the map - * @param geoPosition the new property value - */ - public void setCenterPosition(GeoPosition geoPosition) - { - GeoPosition oldVal = getCenterPosition(); - setCenter(getTileFactory().geoToPixel(geoPosition, zoomLevel)); - repaint(); - GeoPosition newVal = getCenterPosition(); - firePropertyChange("centerPosition", oldVal, newVal); - } - - /** - * A property indicating the center position of the map - * @return the current center position - */ - public GeoPosition getCenterPosition() - { - return getTileFactory().pixelToGeo(getCenter(), zoomLevel); - } - - /** - * Get the current factory - * @return the current property value - */ - public TileFactory getTileFactory() - { - return factory; - } - - /** - * Set the current tile factory (must not be null) - * @param factory the new property value - */ - public void setTileFactory(TileFactory factory) - { - if (factory == null) - throw new NullPointerException("factory must not be null"); - - this.factory.removeTileListener(tileLoadListener); - this.factory.dispose(); - - this.factory = factory; - this.setZoom(factory.getInfo().getDefaultZoomLevel()); - - factory.addTileListener(tileLoadListener); - - repaint(); - } - - /** - * A property for an image which will be display when an image is still loading. - * @return the current property value - */ - public Image getLoadingImage() - { - return loadingImage; - } - - /** - * A property for an image which will be display when an image is still loading. - * @param loadingImage the new property value - */ - public void setLoadingImage(Image loadingImage) - { - this.loadingImage = loadingImage; - } - - /** - * Gets the current pixel center of the map. This point is in the global bitmap coordinate system, not as lat/longs. - * @return the current center of the map as a pixel value - */ - public Point2D getCenter() - { - return center; - } - - /** - * Sets the new center of the map in pixel coordinates. - * @param center the new center of the map in pixel coordinates - */ - public void setCenter(Point2D center) - { - Point2D old = this.getCenter(); - - double centerX = center.getX(); - double centerY = center.getY(); - - Dimension mapSize = getTileFactory().getMapSize(getZoom()); - int mapHeight = (int) mapSize.getHeight() * getTileFactory().getTileSize(getZoom()); - int mapWidth = (int) mapSize.getWidth() * getTileFactory().getTileSize(getZoom()); - - if (isRestrictOutsidePanning()) - { - Insets insets = getInsets(); - int viewportHeight = getHeight() - insets.top - insets.bottom; - int viewportWidth = getWidth() - insets.left - insets.right; - - // don't let the user pan over the top edge - Rectangle newVP = calculateViewportBounds(center); - if (newVP.getY() < 0) - { - centerY = viewportHeight / 2; - } - - // don't let the user pan over the left edge - if (!isHorizontalWrapped() && newVP.getX() < 0) - { - centerX = viewportWidth / 2; - } - - // don't let the user pan over the bottom edge - if (newVP.getY() + newVP.getHeight() > mapHeight) - { - centerY = mapHeight - viewportHeight / 2; - } - - // don't let the user pan over the right edge - if (!isHorizontalWrapped() && (newVP.getX() + newVP.getWidth() > mapWidth)) - { - centerX = mapWidth - viewportWidth / 2; - } - - // if map is to small then just center it vert - if (mapHeight < newVP.getHeight()) - { - centerY = mapHeight / 2;// viewportHeight/2;// - mapHeight/2; - } - - // if map is too small then just center it horiz - if (!isHorizontalWrapped() && mapWidth < newVP.getWidth()) - { - centerX = mapWidth / 2; - } - } - - // If center is outside (0, 0,mapWidth, mapHeight) - // compute modulo to get it back in. - { - centerX = centerX % mapWidth; - centerY = centerY % mapHeight; - - if (centerX < 0) - centerX += mapWidth; - - if (centerY < 0) - centerY += mapHeight; - } - - GeoPosition oldGP = this.getCenterPosition(); - this.center = new Point2D.Double(centerX, centerY); - firePropertyChange("center", old, this.center); - firePropertyChange("centerPosition", oldGP, this.getCenterPosition()); - repaint(); - } - - /** - * Calculates a zoom level so that all points in the specified set will be visible on screen. This is useful if you - * have a bunch of points in an area like a city and you want to zoom out so that the entire city and it's points - * are visible without panning. - * @param positions A set of GeoPositions to calculate the new zoom from - */ - public void calculateZoomFrom(Set positions) - { - // u.p("calculating a zoom based on: "); - // u.p(positions); - if (positions.size() < 2) - { - return; - } - - int zoom = getZoom(); - Rectangle2D rect = generateBoundingRect(positions, zoom); - // Rectangle2D viewport = map.getViewportBounds(); - int count = 0; - while (!getViewportBounds().contains(rect)) - { - // u.p("not contained"); - Point2D centr = new Point2D.Double(rect.getX() + rect.getWidth() / 2, rect.getY() + rect.getHeight() / 2); - GeoPosition px = getTileFactory().pixelToGeo(centr, zoom); - // u.p("new geo = " + px); - setCenterPosition(px); - count++; - if (count > 30) - break; - - if (getViewportBounds().contains(rect)) - { - // u.p("did it finally"); - break; - } - zoom = zoom + 1; - if (zoom > 15) - { - break; - } - setZoom(zoom); - rect = generateBoundingRect(positions, zoom); - } - } - - private Rectangle2D generateBoundingRect(final Set positions, int zoom) - { - Point2D point1 = getTileFactory().geoToPixel(positions.iterator().next(), zoom); - Rectangle2D rect = new Rectangle2D.Double(point1.getX(), point1.getY(), 0, 0); - - for (GeoPosition pos : positions) - { - Point2D point = getTileFactory().geoToPixel(pos, zoom); - rect.add(point); - } - return rect; - } - - // a property change listener which forces repaints when tiles finish loading - private TileListener tileLoadListener = new TileListener() - { - @Override - public void tileLoaded(Tile tile) - { - if (tile.getZoom() == getZoom()) - { - repaint(); - /* this optimization doesn't save much and it doesn't work if you - * wrap around the world - Rectangle viewportBounds = getViewportBounds(); - TilePoint tilePoint = t.getLocation(); - Point point = new Point(tilePoint.getX() * getTileFactory().getTileSize(), tilePoint.getY() * getTileFactory().getTileSize()); - Rectangle tileRect = new Rectangle(point, new Dimension(getTileFactory().getTileSize(), getTileFactory().getTileSize())); - if (viewportBounds.intersects(tileRect)) { - //convert tileRect from world space to viewport space - repaint(new Rectangle( - tileRect.x - viewportBounds.x, - tileRect.y - viewportBounds.y, - tileRect.width, - tileRect.height - )); - }*/ - } - } - - }; - - /** - * @return true if panning is restricted or not - */ - public boolean isRestrictOutsidePanning() - { - return restrictOutsidePanning; - } - - /** - * @param restrictOutsidePanning set if panning is restricted or not - */ - public void setRestrictOutsidePanning(boolean restrictOutsidePanning) - { - this.restrictOutsidePanning = restrictOutsidePanning; - } - - /** - * @return true if horizontally wrapped or not - */ - public boolean isHorizontalWrapped() - { - return horizontalWrapped; - } - - /** - * @param horizontalWrapped true if horizontal wrap is enabled - */ - public void setHorizontalWrapped(boolean horizontalWrapped) - { - this.horizontalWrapped = horizontalWrapped; - } - - /** - * Converts the specified GeoPosition to a point in the JXMapViewer's local coordinate space. This method is - * especially useful when drawing lat/long positions on the map. - * @param pos a GeoPosition on the map - * @return the point in the local coordinate space of the map - */ - public Point2D convertGeoPositionToPoint(GeoPosition pos) - { - // convert from geo to world bitmap - Point2D pt = getTileFactory().geoToPixel(pos, getZoom()); - // convert from world bitmap to local - Rectangle bounds = getViewportBounds(); - return new Point2D.Double(pt.getX() - bounds.getX(), pt.getY() - bounds.getY()); - } - - /** - * Converts the specified Point2D in the JXMapViewer's local coordinate space to a GeoPosition on the map. This - * method is especially useful for determining the GeoPosition under the mouse cursor. - * @param pt a point in the local coordinate space of the map - * @return the point converted to a GeoPosition - */ - public GeoPosition convertPointToGeoPosition(Point2D pt) - { - // convert from local to world bitmap - Rectangle bounds = getViewportBounds(); - Point2D pt2 = new Point2D.Double(pt.getX() + bounds.getX(), pt.getY() + bounds.getY()); - - // convert from world bitmap to geo - GeoPosition pos = getTileFactory().pixelToGeo(pt2, getZoom()); - return pos; - } - - - - /** - * @return isNegativeYAllowed - */ - public boolean isNegativeYAllowed() - { - return isNegativeYAllowed; - } -} +/* + * MapViewer.java + * + * Created on March 14, 2006, 2:14 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package org.jdesktop.swingx; + +import org.jdesktop.swingx.mapviewer.GeoPosition; +import org.jdesktop.swingx.mapviewer.Tile; +import org.jdesktop.swingx.mapviewer.TileFactory; +import org.jdesktop.swingx.mapviewer.TileFactoryInfo; +import org.jdesktop.swingx.mapviewer.TileListener; +import org.jdesktop.swingx.mapviewer.empty.EmptyTileFactory; +import org.jdesktop.swingx.painter.AbstractPainter; +import org.jdesktop.swingx.painter.Painter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.swing.*; +import java.awt.*; +import java.awt.geom.Point2D; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.beans.DesignMode; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.util.Set; + +/** + * A tile oriented map component that can easily be used with tile sources + * on the web like Google and Yahoo maps, satellite data such as NASA imagery, + * and also with file based sources like pre-processed NASA images. + * A known map provider can be used with the SLMapServerInfo, + * which will connect to a 2km resolution version of NASA's Blue Marble Next Generation + * imagery. @see SLMapServerInfo for more information. + * + * Note, the JXMapViewer has three center point properties. The addressLocation property + * represents an abstract center of the map. This would usually be something like the first item + * in a search result. It is a {@link GeoPosition}. The centerPosition property represents + * the current center point of the map. If the user pans the map then the centerPosition point will + * change but the addressLocation will not. Calling recenterToAddressLocation() will move the map + * back to that center address. The center property represents the same point as the centerPosition + * property, but as a Point2D in pixel space instead of a GeoPosition in lat/long space. Note that + * the center property is a Point2D in the entire world bitmap, not in the portion of the map currently + * visible. You can use the getViewportBounds() method to find the portion of the map currently visible + * and adjust your calculations accordingly. Changing the center property will change the centerPosition + * property and vice versa. All three properties are bound. + * @author Joshua.Marinacci@sun.com + * @see org.jdesktop.swingx.mapviewer.bmng.SLMapServerInfo + */ +public class JXMapViewer extends JPanel implements DesignMode +{ + private static final long serialVersionUID = -3530746298586937321L; + + private final static Logger mLog = + LoggerFactory.getLogger( JXMapViewer.class ); + + private final boolean isNegativeYAllowed = true; // maybe rename to isNorthBounded and isSouthBounded? + + /** + * The zoom level. Generally a value between 1 and 15 (TODO Is this true for all the mapping worlds? What does this + * mean if some mapping system doesn't support the zoom level? + */ + private int zoomLevel = 1; + + /** + * The position, in map coordinates of the center point. This is defined as the distance from the top and + * left edges of the map in pixels. Dragging the map component will change the center position. Zooming in/out will + * cause the center to be recalculated so as to remain in the center of the new "map". + */ + private Point2D center = new Point2D.Double(0, 0); + + /** + * Indicates whether or not to draw the borders between tiles. Defaults to false. TODO Generally not very nice + * looking, very much a product of testing Consider whether this should really be a property or not. + */ + private boolean drawTileBorders = false; + + /** + * Factory used by this component to grab the tiles necessary for painting the map. + */ + private TileFactory factory; + + /** + * The position in latitude/longitude of the "address" being mapped. This is a special coordinate that, when moved, + * will cause the map to be moved as well. It is separate from "center" in that "center" tracks the current center + * (in pixels) of the viewport whereas this will not change when panning or zooming. Whenever the addressLocation is + * changed, however, the map will be repositioned. + */ + private GeoPosition addressLocation; + + /** + * The overlay to delegate to for painting the "foreground" of the map component. This would include painting + * waypoints, day/night, etc. Also receives mouse events. + */ + private Painter overlay; + + private boolean designTime; + + private Image loadingImage; + + private boolean restrictOutsidePanning = true; + private boolean horizontalWrapped = true; + + /** + * Create a new JXMapViewer. By default it will use the EmptyTileFactory + */ + public JXMapViewer() + { + factory = new EmptyTileFactory(); + // setTileFactory(new GoogleTileFactory()); + + // make a dummy loading image + try + { + ImageIcon imageIcon = new ImageIcon( "images/loading.png" ); + this.setLoadingImage( imageIcon.getImage() ); + } + catch (Throwable ex) + { + + mLog.error( "JXMapViewer could not load 'loading.png'" ); + + BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB); + Graphics2D g2 = img.createGraphics(); + g2.setColor(Color.black); + g2.fillRect(0, 0, 16, 16); + g2.dispose(); + this.setLoadingImage(img); + } + + // setAddressLocation(new GeoPosition(37.392137,-121.950431)); // Sun campus + } + + @Override + protected void paintComponent(Graphics g) + { + super.paintComponent(g); + + doPaintComponent(g); + } + + // the method that does the actual painting + private void doPaintComponent(Graphics g) + {/* + * if (isOpaque() || isDesignTime()) { g.setColor(getBackground()); g.fillRect(0,0,getWidth(),getHeight()); } + */ + + if (isDesignTime()) + { + // do nothing + } + else + { + int z = getZoom(); + Rectangle viewportBounds = getViewportBounds(); + drawMapTiles(g, z, viewportBounds); + drawOverlays(z, g, viewportBounds); + } + + super.paintBorder(g); + } + + /** + * Indicate that the component is being used at design time, such as in a visual editor like NetBeans' Matisse + * @param b indicates if the component is being used at design time + */ + @Override + public void setDesignTime(boolean b) + { + this.designTime = b; + } + + /** + * Indicates whether the component is being used at design time, such as in a visual editor like NetBeans' Matisse + * @return boolean indicating if the component is being used at design time + */ + @Override + public boolean isDesignTime() + { + return designTime; + } + + /** + * Draw the map tiles. This method is for implementation use only. + * @param g Graphics + * @param zoom zoom level to draw at + * @param viewportBounds the bounds to draw within + */ + protected void drawMapTiles(final Graphics g, final int zoom, Rectangle viewportBounds) + { + int size = getTileFactory().getTileSize(zoom); + Dimension mapSize = getTileFactory().getMapSize(zoom); + + // calculate the "visible" viewport area in tiles + int numWide = viewportBounds.width / size + 2; + int numHigh = viewportBounds.height / size + 2; + + // TilePoint topLeftTile = getTileFactory().getTileCoordinate( + // new Point2D.Double(viewportBounds.x, viewportBounds.y)); + TileFactoryInfo info = getTileFactory().getInfo(); + int tpx = (int) Math.floor(viewportBounds.getX() / info.getTileSize(0)); + int tpy = (int) Math.floor(viewportBounds.getY() / info.getTileSize(0)); + // TilePoint topLeftTile = new TilePoint(tpx, tpy); + + // p("top tile = " + topLeftTile); + // fetch the tiles from the factory and store them in the tiles cache + // attach the tileLoadListener + for (int x = 0; x <= numWide; x++) + { + for (int y = 0; y <= numHigh; y++) + { + int itpx = x + tpx;// topLeftTile.getX(); + int itpy = y + tpy;// topLeftTile.getY(); + // TilePoint point = new TilePoint(x + topLeftTile.getX(), y + topLeftTile.getY()); + // only proceed if the specified tile point lies within the area being painted + if (g.getClipBounds().intersects( + new Rectangle(itpx * size - viewportBounds.x, itpy * size - viewportBounds.y, size, size))) + { + Tile tile = getTileFactory().getTile(itpx, itpy, zoom); + int ox = ((itpx * getTileFactory().getTileSize(zoom)) - viewportBounds.x); + int oy = ((itpy * getTileFactory().getTileSize(zoom)) - viewportBounds.y); + + // if the tile is off the map to the north/south, then just don't paint anything + if (isTileOnMap(itpx, itpy, mapSize)) + { + if (isOpaque()) + { + g.setColor(getBackground()); + g.fillRect(ox, oy, size, size); + } + } + else if (tile.isLoaded()) + { + g.drawImage(tile.getImage(), ox, oy, null); + } + else + { + // Use tile at higher zoom level with 200% magnification + Tile superTile = getTileFactory().getTile(itpx / 2, itpy / 2, zoom + 1); + + if (superTile.isLoaded()) + { + int offX = (itpx % 2) * size / 2; + int offY = (itpy % 2) * size / 2; + g.drawImage(superTile.getImage(), ox, oy, ox + size, oy + size, offX, offY, offX + size / 2, offY + size / 2, null); + } + else + { + int imageX = (getTileFactory().getTileSize(zoom) - getLoadingImage().getWidth(null)) / 2; + int imageY = (getTileFactory().getTileSize(zoom) - getLoadingImage().getHeight(null)) / 2; + g.setColor(Color.GRAY); + g.fillRect(ox, oy, size, size); + g.drawImage(getLoadingImage(), ox + imageX, oy + imageY, null); + } + } + if (isDrawTileBorders()) + { + + g.setColor(Color.black); + g.drawRect(ox, oy, size, size); + g.drawRect(ox + size / 2 - 5, oy + size / 2 - 5, 10, 10); + g.setColor(Color.white); + g.drawRect(ox + 1, oy + 1, size, size); + + String text = itpx + ", " + itpy + ", " + getZoom(); + g.setColor(Color.BLACK); + g.drawString(text, ox + 10, oy + 30); + g.drawString(text, ox + 10 + 2, oy + 30 + 2); + g.setColor(Color.WHITE); + g.drawString(text, ox + 10 + 1, oy + 30 + 1); + } + } + } + } + } + + @SuppressWarnings("unused") + private void drawOverlays(final int zoom, final Graphics g, final Rectangle viewportBounds) + { + if (overlay != null) + { + overlay.paint((Graphics2D) g, this, getWidth(), getHeight()); + } + } + + @SuppressWarnings("unused") + private boolean isTileOnMap(int x, int y, Dimension mapSize) + { + return !isNegativeYAllowed && y < 0 || y >= mapSize.getHeight(); + } + + /** + * Sets the map overlay. This is a Painter which will paint on top of the map. It can be used to draw waypoints, + * lines, or static overlays like text messages. + * @param overlay the map overlay to use + */ + public void setOverlayPainter(Painter overlay) + { + Painter old = getOverlayPainter(); + this.overlay = overlay; + + PropertyChangeListener listener = new PropertyChangeListener() + { + @Override + public void propertyChange(PropertyChangeEvent evt) + { + if (evt.getNewValue().equals(Boolean.TRUE)) + { + repaint(); + } + } + }; + + if (old instanceof AbstractPainter) + { + AbstractPainter ap = (AbstractPainter) overlay; + ap.removePropertyChangeListener("dirty", listener); + } + + if (overlay instanceof AbstractPainter) + { + AbstractPainter ap = (AbstractPainter) overlay; + ap.addPropertyChangeListener("dirty", listener); + } + + firePropertyChange("mapOverlay", old, getOverlayPainter()); + repaint(); + } + + /** + * Gets the current map overlay + * @return the current map overlay + */ + public Painter getOverlayPainter() + { + return overlay; + } + + /** + * Returns the bounds of the viewport in pixels. This can be used to transform points into the world bitmap + * coordinate space. + * @return the bounds in pixels of the "view" of this map + */ + public Rectangle getViewportBounds() + { + return calculateViewportBounds(getCenter()); + } + + private Rectangle calculateViewportBounds(Point2D centr) + { + Insets insets = getInsets(); + // calculate the "visible" viewport area in pixels + int viewportWidth = getWidth() - insets.left - insets.right; + int viewportHeight = getHeight() - insets.top - insets.bottom; + double viewportX = (centr.getX() - viewportWidth / 2); + double viewportY = (centr.getY() - viewportHeight / 2); + return new Rectangle((int) viewportX, (int) viewportY, viewportWidth, viewportHeight); + } + + /** + * Set the current zoom level + * @param zoom the new zoom level + */ + public void setZoom(int zoom) + { + if (zoom == this.zoomLevel) + { + return; + } + + TileFactoryInfo info = getTileFactory().getInfo(); + // don't repaint if we are out of the valid zoom levels + if (info != null && (zoom < info.getMinimumZoomLevel() || zoom > info.getMaximumZoomLevel())) + { + return; + } + + // if(zoom >= 0 && zoom <= 15 && zoom != this.zoom) { + int oldzoom = this.zoomLevel; + Point2D oldCenter = getCenter(); + Dimension oldMapSize = getTileFactory().getMapSize(oldzoom); + this.zoomLevel = zoom; + this.firePropertyChange("zoom", oldzoom, zoom); + + Dimension mapSize = getTileFactory().getMapSize(zoom); + + setCenter(new Point2D.Double(oldCenter.getX() * (mapSize.getWidth() / oldMapSize.getWidth()), oldCenter.getY() + * (mapSize.getHeight() / oldMapSize.getHeight()))); + + repaint(); + } + + /** + * Gets the current zoom level + * @return the current zoom level + */ + public int getZoom() + { + return this.zoomLevel; + } + + /** + * Gets the current address location of the map. This property does not change when the user pans the map. This + * property is bound. + * @return the current map location (address) + */ + public GeoPosition getAddressLocation() + { + return addressLocation; + } + + /** + * Gets the current address location of the map + * @param addressLocation the new address location + */ + public void setAddressLocation(GeoPosition addressLocation) + { + GeoPosition old = getAddressLocation(); + this.addressLocation = addressLocation; + setCenter(getTileFactory().geoToPixel(addressLocation, getZoom())); + + firePropertyChange("addressLocation", old, getAddressLocation()); + repaint(); + } + + /** + * Re-centers the map to have the current address location be at the center of the map, accounting for the map's + * width and height. + */ + public void recenterToAddressLocation() + { + setCenter(getTileFactory().geoToPixel(getAddressLocation(), getZoom())); + repaint(); + } + + /** + * Indicates if the tile borders should be drawn. Mainly used for debugging. + * @return the value of this property + */ + public boolean isDrawTileBorders() + { + return drawTileBorders; + } + + /** + * Set if the tile borders should be drawn. Mainly used for debugging. + * @param drawTileBorders new value of this drawTileBorders + */ + public void setDrawTileBorders(boolean drawTileBorders) + { + boolean old = isDrawTileBorders(); + this.drawTileBorders = drawTileBorders; + firePropertyChange("drawTileBorders", old, isDrawTileBorders()); + repaint(); + } + + /** + * A property indicating the center position of the map + * @param geoPosition the new property value + */ + public void setCenterPosition(GeoPosition geoPosition) + { + GeoPosition oldVal = getCenterPosition(); + setCenter(getTileFactory().geoToPixel(geoPosition, zoomLevel)); + repaint(); + GeoPosition newVal = getCenterPosition(); + firePropertyChange("centerPosition", oldVal, newVal); + } + + /** + * A property indicating the center position of the map + * @return the current center position + */ + public GeoPosition getCenterPosition() + { + return getTileFactory().pixelToGeo(getCenter(), zoomLevel); + } + + /** + * Get the current factory + * @return the current property value + */ + public TileFactory getTileFactory() + { + return factory; + } + + /** + * Set the current tile factory (must not be null) + * @param factory the new property value + */ + public void setTileFactory(TileFactory factory) + { + if (factory == null) + throw new NullPointerException("factory must not be null"); + + this.factory.removeTileListener(tileLoadListener); + this.factory.dispose(); + + this.factory = factory; + this.setZoom(factory.getInfo().getDefaultZoomLevel()); + + factory.addTileListener(tileLoadListener); + + repaint(); + } + + /** + * A property for an image which will be display when an image is still loading. + * @return the current property value + */ + public Image getLoadingImage() + { + return loadingImage; + } + + /** + * A property for an image which will be display when an image is still loading. + * @param loadingImage the new property value + */ + public void setLoadingImage(Image loadingImage) + { + this.loadingImage = loadingImage; + } + + /** + * Gets the current pixel center of the map. This point is in the global bitmap coordinate system, not as lat/longs. + * @return the current center of the map as a pixel value + */ + public Point2D getCenter() + { + return center; + } + + /** + * Sets the new center of the map in pixel coordinates. + * @param center the new center of the map in pixel coordinates + */ + public void setCenter(Point2D center) + { + Point2D old = this.getCenter(); + + double centerX = center.getX(); + double centerY = center.getY(); + + Dimension mapSize = getTileFactory().getMapSize(getZoom()); + int mapHeight = (int) mapSize.getHeight() * getTileFactory().getTileSize(getZoom()); + int mapWidth = (int) mapSize.getWidth() * getTileFactory().getTileSize(getZoom()); + + if (isRestrictOutsidePanning()) + { + Insets insets = getInsets(); + int viewportHeight = getHeight() - insets.top - insets.bottom; + int viewportWidth = getWidth() - insets.left - insets.right; + + // don't let the user pan over the top edge + Rectangle newVP = calculateViewportBounds(center); + if (newVP.getY() < 0) + { + centerY = viewportHeight / 2; + } + + // don't let the user pan over the left edge + if (!isHorizontalWrapped() && newVP.getX() < 0) + { + centerX = viewportWidth / 2; + } + + // don't let the user pan over the bottom edge + if (newVP.getY() + newVP.getHeight() > mapHeight) + { + centerY = mapHeight - viewportHeight / 2; + } + + // don't let the user pan over the right edge + if (!isHorizontalWrapped() && (newVP.getX() + newVP.getWidth() > mapWidth)) + { + centerX = mapWidth - viewportWidth / 2; + } + + // if map is to small then just center it vert + if (mapHeight < newVP.getHeight()) + { + centerY = mapHeight / 2;// viewportHeight/2;// - mapHeight/2; + } + + // if map is too small then just center it horiz + if (!isHorizontalWrapped() && mapWidth < newVP.getWidth()) + { + centerX = mapWidth / 2; + } + } + + // If center is outside (0, 0,mapWidth, mapHeight) + // compute modulo to get it back in. + { + centerX = centerX % mapWidth; + centerY = centerY % mapHeight; + + if (centerX < 0) + centerX += mapWidth; + + if (centerY < 0) + centerY += mapHeight; + } + + GeoPosition oldGP = this.getCenterPosition(); + this.center = new Point2D.Double(centerX, centerY); + firePropertyChange("center", old, this.center); + firePropertyChange("centerPosition", oldGP, this.getCenterPosition()); + repaint(); + } + + /** + * Calculates a zoom level so that all points in the specified set will be visible on screen. This is useful if you + * have a bunch of points in an area like a city and you want to zoom out so that the entire city and it's points + * are visible without panning. + * @param positions A set of GeoPositions to calculate the new zoom from + */ + public void calculateZoomFrom(Set positions) + { + // u.p("calculating a zoom based on: "); + // u.p(positions); + if (positions.size() < 2) + { + return; + } + + int zoom = getZoom(); + Rectangle2D rect = generateBoundingRect(positions, zoom); + // Rectangle2D viewport = map.getViewportBounds(); + int count = 0; + while (!getViewportBounds().contains(rect)) + { + // u.p("not contained"); + Point2D centr = new Point2D.Double(rect.getX() + rect.getWidth() / 2, rect.getY() + rect.getHeight() / 2); + GeoPosition px = getTileFactory().pixelToGeo(centr, zoom); + // u.p("new geo = " + px); + setCenterPosition(px); + count++; + if (count > 30) + break; + + if (getViewportBounds().contains(rect)) + { + // u.p("did it finally"); + break; + } + zoom = zoom + 1; + if (zoom > 15) + { + break; + } + setZoom(zoom); + rect = generateBoundingRect(positions, zoom); + } + } + + private Rectangle2D generateBoundingRect(final Set positions, int zoom) + { + Point2D point1 = getTileFactory().geoToPixel(positions.iterator().next(), zoom); + Rectangle2D rect = new Rectangle2D.Double(point1.getX(), point1.getY(), 0, 0); + + for (GeoPosition pos : positions) + { + Point2D point = getTileFactory().geoToPixel(pos, zoom); + rect.add(point); + } + return rect; + } + + // a property change listener which forces repaints when tiles finish loading + private TileListener tileLoadListener = new TileListener() + { + @Override + public void tileLoaded(Tile tile) + { + if (tile.getZoom() == getZoom()) + { + repaint(); + /* this optimization doesn't save much and it doesn't work if you + * wrap around the world + Rectangle viewportBounds = getViewportBounds(); + TilePoint tilePoint = t.getLocation(); + Point point = new Point(tilePoint.getX() * getTileFactory().getTileSize(), tilePoint.getY() * getTileFactory().getTileSize()); + Rectangle tileRect = new Rectangle(point, new Dimension(getTileFactory().getTileSize(), getTileFactory().getTileSize())); + if (viewportBounds.intersects(tileRect)) { + //convert tileRect from world space to viewport space + repaint(new Rectangle( + tileRect.x - viewportBounds.x, + tileRect.y - viewportBounds.y, + tileRect.width, + tileRect.height + )); + }*/ + } + } + + }; + + /** + * @return true if panning is restricted or not + */ + public boolean isRestrictOutsidePanning() + { + return restrictOutsidePanning; + } + + /** + * @param restrictOutsidePanning set if panning is restricted or not + */ + public void setRestrictOutsidePanning(boolean restrictOutsidePanning) + { + this.restrictOutsidePanning = restrictOutsidePanning; + } + + /** + * @return true if horizontally wrapped or not + */ + public boolean isHorizontalWrapped() + { + return horizontalWrapped; + } + + /** + * @param horizontalWrapped true if horizontal wrap is enabled + */ + public void setHorizontalWrapped(boolean horizontalWrapped) + { + this.horizontalWrapped = horizontalWrapped; + } + + /** + * Converts the specified GeoPosition to a point in the JXMapViewer's local coordinate space. This method is + * especially useful when drawing lat/long positions on the map. + * @param pos a GeoPosition on the map + * @return the point in the local coordinate space of the map + */ + public Point2D convertGeoPositionToPoint(GeoPosition pos) + { + // convert from geo to world bitmap + Point2D pt = getTileFactory().geoToPixel(pos, getZoom()); + // convert from world bitmap to local + Rectangle bounds = getViewportBounds(); + return new Point2D.Double(pt.getX() - bounds.getX(), pt.getY() - bounds.getY()); + } + + /** + * Converts the specified Point2D in the JXMapViewer's local coordinate space to a GeoPosition on the map. This + * method is especially useful for determining the GeoPosition under the mouse cursor. + * @param pt a point in the local coordinate space of the map + * @return the point converted to a GeoPosition + */ + public GeoPosition convertPointToGeoPosition(Point2D pt) + { + // convert from local to world bitmap + Rectangle bounds = getViewportBounds(); + Point2D pt2 = new Point2D.Double(pt.getX() + bounds.getX(), pt.getY() + bounds.getY()); + + // convert from world bitmap to geo + GeoPosition pos = getTileFactory().pixelToGeo(pt2, getZoom()); + return pos; + } + + + + /** + * @return isNegativeYAllowed + */ + public boolean isNegativeYAllowed() + { + return isNegativeYAllowed; + } +} diff --git a/src/org/jdesktop/swingx/OSMTileFactoryInfo.java b/src/main/java/org/jdesktop/swingx/OSMTileFactoryInfo.java similarity index 100% rename from src/org/jdesktop/swingx/OSMTileFactoryInfo.java rename to src/main/java/org/jdesktop/swingx/OSMTileFactoryInfo.java diff --git a/src/org/jdesktop/swingx/VirtualEarthTileFactoryInfo.java b/src/main/java/org/jdesktop/swingx/VirtualEarthTileFactoryInfo.java similarity index 100% rename from src/org/jdesktop/swingx/VirtualEarthTileFactoryInfo.java rename to src/main/java/org/jdesktop/swingx/VirtualEarthTileFactoryInfo.java diff --git a/src/org/jdesktop/swingx/input/CenterMapListener.java b/src/main/java/org/jdesktop/swingx/input/CenterMapListener.java similarity index 97% rename from src/org/jdesktop/swingx/input/CenterMapListener.java rename to src/main/java/org/jdesktop/swingx/input/CenterMapListener.java index 34eb7fa1..6eb0fba4 100644 --- a/src/org/jdesktop/swingx/input/CenterMapListener.java +++ b/src/main/java/org/jdesktop/swingx/input/CenterMapListener.java @@ -17,15 +17,14 @@ ******************************************************************************/ package org.jdesktop.swingx.input; -import java.awt.Rectangle; +import org.jdesktop.swingx.JXMapViewer; + +import javax.swing.*; +import java.awt.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.geom.Point2D; -import javax.swing.SwingUtilities; - -import org.jdesktop.swingx.JXMapViewer; - /** * Centers the map on the mouse cursor * if left is double-clicked or middle mouse diff --git a/src/org/jdesktop/swingx/input/PanKeyListener.java b/src/main/java/org/jdesktop/swingx/input/PanKeyListener.java similarity index 98% rename from src/org/jdesktop/swingx/input/PanKeyListener.java rename to src/main/java/org/jdesktop/swingx/input/PanKeyListener.java index cdb7d13d..2995ad3b 100644 --- a/src/org/jdesktop/swingx/input/PanKeyListener.java +++ b/src/main/java/org/jdesktop/swingx/input/PanKeyListener.java @@ -17,13 +17,13 @@ ******************************************************************************/ package org.jdesktop.swingx.input; -import java.awt.Rectangle; +import org.jdesktop.swingx.JXMapViewer; + +import java.awt.*; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.awt.geom.Point2D; -import org.jdesktop.swingx.JXMapViewer; - /** * used to pan using the arrow keys * @author joshy diff --git a/src/org/jdesktop/swingx/input/PanMouseInputListener.java b/src/main/java/org/jdesktop/swingx/input/PanMouseInputListener.java similarity index 96% rename from src/org/jdesktop/swingx/input/PanMouseInputListener.java rename to src/main/java/org/jdesktop/swingx/input/PanMouseInputListener.java index 739d772f..7bcc3564 100644 --- a/src/org/jdesktop/swingx/input/PanMouseInputListener.java +++ b/src/main/java/org/jdesktop/swingx/input/PanMouseInputListener.java @@ -17,16 +17,14 @@ ******************************************************************************/ package org.jdesktop.swingx.input; -import java.awt.Cursor; -import java.awt.Point; +import org.jdesktop.swingx.JXMapViewer; + +import javax.swing.*; +import javax.swing.event.MouseInputAdapter; +import java.awt.*; import java.awt.event.MouseEvent; import java.awt.geom.Point2D; -import javax.swing.SwingUtilities; -import javax.swing.event.MouseInputAdapter; - -import org.jdesktop.swingx.JXMapViewer; - /** * Used to pan using press and drag mouse gestures * @author joshy diff --git a/src/org/jdesktop/swingx/input/ZoomMouseWheelListenerCenter.java b/src/main/java/org/jdesktop/swingx/input/ZoomMouseWheelListenerCenter.java similarity index 100% rename from src/org/jdesktop/swingx/input/ZoomMouseWheelListenerCenter.java rename to src/main/java/org/jdesktop/swingx/input/ZoomMouseWheelListenerCenter.java index ce639740..a8b6b7f5 100644 --- a/src/org/jdesktop/swingx/input/ZoomMouseWheelListenerCenter.java +++ b/src/main/java/org/jdesktop/swingx/input/ZoomMouseWheelListenerCenter.java @@ -17,11 +17,11 @@ ******************************************************************************/ package org.jdesktop.swingx.input; +import org.jdesktop.swingx.JXMapViewer; + import java.awt.event.MouseWheelEvent; import java.awt.event.MouseWheelListener; -import org.jdesktop.swingx.JXMapViewer; - /** * zooms using the mouse wheel on the view center * @author joshy diff --git a/src/org/jdesktop/swingx/input/ZoomMouseWheelListenerCursor.java b/src/main/java/org/jdesktop/swingx/input/ZoomMouseWheelListenerCursor.java similarity index 96% rename from src/org/jdesktop/swingx/input/ZoomMouseWheelListenerCursor.java rename to src/main/java/org/jdesktop/swingx/input/ZoomMouseWheelListenerCursor.java index dfcca236..cda6cdab 100644 --- a/src/org/jdesktop/swingx/input/ZoomMouseWheelListenerCursor.java +++ b/src/main/java/org/jdesktop/swingx/input/ZoomMouseWheelListenerCursor.java @@ -17,15 +17,13 @@ ******************************************************************************/ package org.jdesktop.swingx.input; -import java.awt.Dimension; -import java.awt.Point; -import java.awt.Rectangle; +import org.jdesktop.swingx.JXMapViewer; + +import java.awt.*; import java.awt.event.MouseWheelEvent; import java.awt.event.MouseWheelListener; import java.awt.geom.Point2D; -import org.jdesktop.swingx.JXMapViewer; - /** * zooms to the current mouse cursor * using the mouse wheel diff --git a/src/org/jdesktop/swingx/mapviewer/AbstractTileFactory.java b/src/main/java/org/jdesktop/swingx/mapviewer/AbstractTileFactory.java similarity index 99% rename from src/org/jdesktop/swingx/mapviewer/AbstractTileFactory.java rename to src/main/java/org/jdesktop/swingx/mapviewer/AbstractTileFactory.java index 2fe001f9..7b9f2266 100644 --- a/src/org/jdesktop/swingx/mapviewer/AbstractTileFactory.java +++ b/src/main/java/org/jdesktop/swingx/mapviewer/AbstractTileFactory.java @@ -17,6 +17,12 @@ ******************************************************************************/ package org.jdesktop.swingx.mapviewer; +import org.jdesktop.swingx.mapviewer.util.GeoUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.imageio.ImageIO; +import javax.swing.*; import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -35,13 +41,6 @@ import java.util.concurrent.Executors; import java.util.concurrent.PriorityBlockingQueue; import java.util.concurrent.ThreadFactory; -import javax.imageio.ImageIO; -import javax.swing.SwingUtilities; - -import org.jdesktop.swingx.mapviewer.util.GeoUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * The AbstractTileFactory provides * a basic implementation for the TileFactory. diff --git a/src/org/jdesktop/swingx/mapviewer/DefaultTileFactory.java b/src/main/java/org/jdesktop/swingx/mapviewer/DefaultTileFactory.java similarity index 100% rename from src/org/jdesktop/swingx/mapviewer/DefaultTileFactory.java rename to src/main/java/org/jdesktop/swingx/mapviewer/DefaultTileFactory.java diff --git a/src/org/jdesktop/swingx/mapviewer/DefaultWaypoint.java b/src/main/java/org/jdesktop/swingx/mapviewer/DefaultWaypoint.java similarity index 94% rename from src/org/jdesktop/swingx/mapviewer/DefaultWaypoint.java rename to src/main/java/org/jdesktop/swingx/mapviewer/DefaultWaypoint.java index d37dd46e..b094af34 100644 --- a/src/org/jdesktop/swingx/mapviewer/DefaultWaypoint.java +++ b/src/main/java/org/jdesktop/swingx/mapviewer/DefaultWaypoint.java @@ -1,63 +1,63 @@ -/* - * Waypoint.java - * - * Created on March 30, 2006, 5:22 PM - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package org.jdesktop.swingx.mapviewer; - -import org.jdesktop.beans.AbstractBean; - -/** - * @author joshy - */ -public class DefaultWaypoint extends AbstractBean implements Waypoint -{ - private GeoPosition position; - - /** - * Creates a new instance of Waypoint - */ - public DefaultWaypoint() - { - this(new GeoPosition(0, 0)); - } - - /** - * @param latitude the latitude - * @param longitude the longitude - */ - public DefaultWaypoint(double latitude, double longitude) - { - this(new GeoPosition(latitude, longitude)); - } - - /** - * @param coord the geo coordinate - */ - public DefaultWaypoint(GeoPosition coord) - { - this.position = coord; - } - - @Override - public GeoPosition getPosition() - { - return position; - } - - /** - * Set a new GeoPosition for this Waypoint - * @param coordinate a new position - */ - public void setPosition(GeoPosition coordinate) - { - GeoPosition old = getPosition(); - this.position = coordinate; - firePropertyChange("position", old, getPosition()); - } - -} +/* + * Waypoint.java + * + * Created on March 30, 2006, 5:22 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package org.jdesktop.swingx.mapviewer; + +import org.jdesktop.beans.AbstractBean; + +/** + * @author joshy + */ +public class DefaultWaypoint extends AbstractBean implements Waypoint +{ + private GeoPosition position; + + /** + * Creates a new instance of Waypoint + */ + public DefaultWaypoint() + { + this(new GeoPosition(0, 0)); + } + + /** + * @param latitude the latitude + * @param longitude the longitude + */ + public DefaultWaypoint(double latitude, double longitude) + { + this(new GeoPosition(latitude, longitude)); + } + + /** + * @param coord the geo coordinate + */ + public DefaultWaypoint(GeoPosition coord) + { + this.position = coord; + } + + @Override + public GeoPosition getPosition() + { + return position; + } + + /** + * Set a new GeoPosition for this Waypoint + * @param coordinate a new position + */ + public void setPosition(GeoPosition coordinate) + { + GeoPosition old = getPosition(); + this.position = coordinate; + firePropertyChange("position", old, getPosition()); + } + +} diff --git a/src/org/jdesktop/swingx/mapviewer/DefaultWaypointRenderer.java b/src/main/java/org/jdesktop/swingx/mapviewer/DefaultWaypointRenderer.java similarity index 93% rename from src/org/jdesktop/swingx/mapviewer/DefaultWaypointRenderer.java rename to src/main/java/org/jdesktop/swingx/mapviewer/DefaultWaypointRenderer.java index 1ad1a4af..0c9ebd29 100644 --- a/src/org/jdesktop/swingx/mapviewer/DefaultWaypointRenderer.java +++ b/src/main/java/org/jdesktop/swingx/mapviewer/DefaultWaypointRenderer.java @@ -1,61 +1,60 @@ -/* - * WaypointRenderer.java - * - * Created on March 30, 2006, 5:24 PM - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package org.jdesktop.swingx.mapviewer; - -import java.awt.Graphics2D; -import java.awt.geom.Point2D; -import java.awt.image.BufferedImage; - -import javax.imageio.ImageIO; - -import org.jdesktop.swingx.JXMapViewer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This is a standard waypoint renderer. - * @author joshy - */ -public class DefaultWaypointRenderer implements WaypointRenderer -{ - private final static Logger mLog = - LoggerFactory.getLogger( DefaultWaypointRenderer.class ); - - private BufferedImage img = null; - - /** - * Uses a default waypoint image - */ - public DefaultWaypointRenderer() - { - try - { - img = ImageIO.read(getClass().getResource("resources/standard_waypoint.png")); - } - catch (Exception ex) - { - mLog.error("couldn't read standard_waypoint.png", ex ); - } - } - - @Override - public void paintWaypoint(Graphics2D g, JXMapViewer map, Waypoint w) - { - if (img == null) - return; - - Point2D point = map.getTileFactory().geoToPixel(w.getPosition(), map.getZoom()); - - int x = (int)point.getX() -img.getWidth() / 2; - int y = (int)point.getY() -img.getHeight(); - - g.drawImage(img, x, y, null); - } -} +/* + * WaypointRenderer.java + * + * Created on March 30, 2006, 5:24 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package org.jdesktop.swingx.mapviewer; + +import org.jdesktop.swingx.JXMapViewer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.imageio.ImageIO; +import java.awt.*; +import java.awt.geom.Point2D; +import java.awt.image.BufferedImage; + +/** + * This is a standard waypoint renderer. + * @author joshy + */ +public class DefaultWaypointRenderer implements WaypointRenderer +{ + private final static Logger mLog = + LoggerFactory.getLogger( DefaultWaypointRenderer.class ); + + private BufferedImage img = null; + + /** + * Uses a default waypoint image + */ + public DefaultWaypointRenderer() + { + try + { + img = ImageIO.read(getClass().getResource("resources/standard_waypoint.png")); + } + catch (Exception ex) + { + mLog.error("couldn't read standard_waypoint.png", ex ); + } + } + + @Override + public void paintWaypoint(Graphics2D g, JXMapViewer map, Waypoint w) + { + if (img == null) + return; + + Point2D point = map.getTileFactory().geoToPixel(w.getPosition(), map.getZoom()); + + int x = (int)point.getX() -img.getWidth() / 2; + int y = (int)point.getY() -img.getHeight(); + + g.drawImage(img, x, y, null); + } +} diff --git a/src/org/jdesktop/swingx/mapviewer/GeoBounds.java b/src/main/java/org/jdesktop/swingx/mapviewer/GeoBounds.java similarity index 100% rename from src/org/jdesktop/swingx/mapviewer/GeoBounds.java rename to src/main/java/org/jdesktop/swingx/mapviewer/GeoBounds.java diff --git a/src/org/jdesktop/swingx/mapviewer/GeoPosition.java b/src/main/java/org/jdesktop/swingx/mapviewer/GeoPosition.java similarity index 100% rename from src/org/jdesktop/swingx/mapviewer/GeoPosition.java rename to src/main/java/org/jdesktop/swingx/mapviewer/GeoPosition.java diff --git a/src/org/jdesktop/swingx/mapviewer/LocalResponseCache.java b/src/main/java/org/jdesktop/swingx/mapviewer/LocalResponseCache.java similarity index 100% rename from src/org/jdesktop/swingx/mapviewer/LocalResponseCache.java rename to src/main/java/org/jdesktop/swingx/mapviewer/LocalResponseCache.java index f3801e62..81a97865 100644 --- a/src/org/jdesktop/swingx/mapviewer/LocalResponseCache.java +++ b/src/main/java/org/jdesktop/swingx/mapviewer/LocalResponseCache.java @@ -17,6 +17,9 @@ ******************************************************************************/ package org.jdesktop.swingx.mapviewer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; @@ -34,9 +37,6 @@ import java.net.URLConnection; import java.util.List; import java.util.Map; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * @author joshy */ diff --git a/src/org/jdesktop/swingx/mapviewer/Tile.java b/src/main/java/org/jdesktop/swingx/mapviewer/Tile.java similarity index 100% rename from src/org/jdesktop/swingx/mapviewer/Tile.java rename to src/main/java/org/jdesktop/swingx/mapviewer/Tile.java index 1aa33f09..91065e08 100644 --- a/src/org/jdesktop/swingx/mapviewer/Tile.java +++ b/src/main/java/org/jdesktop/swingx/mapviewer/Tile.java @@ -9,11 +9,11 @@ package org.jdesktop.swingx.mapviewer; +import org.jdesktop.beans.AbstractBean; + import java.awt.image.BufferedImage; import java.lang.ref.SoftReference; -import org.jdesktop.beans.AbstractBean; - /** * The Tile class represents a particular square image piece of the world bitmap at a particular zoom level. * @author joshy diff --git a/src/org/jdesktop/swingx/mapviewer/TileCache.java b/src/main/java/org/jdesktop/swingx/mapviewer/TileCache.java similarity index 96% rename from src/org/jdesktop/swingx/mapviewer/TileCache.java rename to src/main/java/org/jdesktop/swingx/mapviewer/TileCache.java index 592f39af..713d9eb3 100644 --- a/src/org/jdesktop/swingx/mapviewer/TileCache.java +++ b/src/main/java/org/jdesktop/swingx/mapviewer/TileCache.java @@ -1,141 +1,140 @@ -/* - * TileCache.java - * - * Created on January 2, 2007, 7:17 PM - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package org.jdesktop.swingx.mapviewer; - -import java.awt.image.BufferedImage; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.net.URI; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.Map; - -import javax.imageio.ImageIO; - -/** - * An implementation only class for now. For internal use only. - * @author joshua.marinacci@sun.com - */ -public class TileCache -{ - private Map imgmap = new HashMap(); - private LinkedList imgmapAccessQueue = new LinkedList(); - private int imagesize = 0; - private Map bytemap = new HashMap(); - private LinkedList bytemapAccessQueue = new LinkedList(); - private int bytesize = 0; - - /** - * Default constructor - Empty - */ - public TileCache() - { - } - - /** - * Put a tile image into the cache. This puts both a buffered image and array of bytes that make up the compressed - * image. - * @param uri URI of image that is being stored in the cache - * @param bimg bytes of the compressed image, ie: the image file that was loaded over the network - * @param img image to store in the cache - */ - public void put(URI uri, byte[] bimg, BufferedImage img) - { - synchronized (bytemap) - { - while (bytesize > 1000 * 1000 * 50) - { - URI olduri = bytemapAccessQueue.removeFirst(); - byte[] oldbimg = bytemap.remove(olduri); - bytesize -= oldbimg.length; - log("removed 1 img from byte cache"); - } - - bytemap.put(uri, bimg); - bytesize += bimg.length; - bytemapAccessQueue.addLast(uri); - } - addToImageCache(uri, img); - } - - /** - * Returns a buffered image for the requested URI from the cache. This method must return null if the image is not - * in the cache. If the image is unavailable but it's compressed version *is* available, then the compressed version - * will be expanded and returned. - * @param uri URI of the image previously put in the cache - * @return the image matching the requested URI, or null if not available - * @throws IOException if retrieval fails - */ - public BufferedImage get(URI uri) throws IOException - { - synchronized (imgmap) - { - if (imgmap.containsKey(uri)) - { - imgmapAccessQueue.remove(uri); - imgmapAccessQueue.addLast(uri); - return imgmap.get(uri); - } - } - synchronized (bytemap) - { - if (bytemap.containsKey(uri)) - { - log("retrieving from bytes"); - bytemapAccessQueue.remove(uri); - bytemapAccessQueue.addLast(uri); - BufferedImage img = ImageIO.read(new ByteArrayInputStream(bytemap.get(uri))); - addToImageCache(uri, img); - return img; - } - } - return null; - } - - /** - * Request that the cache free up some memory. How this happens or how much memory is freed is up to the TileCache - * implementation. Subclasses can implement their own strategy. The default strategy is to clear out all buffered - * images but retain the compressed versions. - */ - public void needMoreMemory() - { - imgmap.clear(); - log("HACK! need more memory: freeing up memory"); - } - - private void addToImageCache(final URI uri, final BufferedImage img) - { - synchronized (imgmap) - { - try { - while (imagesize > 1000 * 1000 * 50) - { - URI olduri = imgmapAccessQueue.removeFirst(); - BufferedImage oldimg = imgmap.remove(olduri); - imagesize -= oldimg.getWidth() * oldimg.getHeight() * 4; - log("removed 1 img from image cache"); - } - imgmap.put(uri, img); - imagesize += img.getWidth() * img.getHeight() * 4; - imgmapAccessQueue.addLast(uri); - } catch (Exception ex) { - log("Failed to load tile at URL. Tile is null"); - } - } -// log("added to cache: " + " uncompressed = " + imgmap.keySet().size() + " / " + imagesize / 1000 + "k" -// + " compressed = " + bytemap.keySet().size() + " / " + bytesize / 1000 + "k"); - } - - private void log(String string) - { -// Log.debug( string ); - } - -} +/* + * TileCache.java + * + * Created on January 2, 2007, 7:17 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package org.jdesktop.swingx.mapviewer; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.net.URI; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.Map; + +/** + * An implementation only class for now. For internal use only. + * @author joshua.marinacci@sun.com + */ +public class TileCache +{ + private Map imgmap = new HashMap(); + private LinkedList imgmapAccessQueue = new LinkedList(); + private int imagesize = 0; + private Map bytemap = new HashMap(); + private LinkedList bytemapAccessQueue = new LinkedList(); + private int bytesize = 0; + + /** + * Default constructor - Empty + */ + public TileCache() + { + } + + /** + * Put a tile image into the cache. This puts both a buffered image and array of bytes that make up the compressed + * image. + * @param uri URI of image that is being stored in the cache + * @param bimg bytes of the compressed image, ie: the image file that was loaded over the network + * @param img image to store in the cache + */ + public void put(URI uri, byte[] bimg, BufferedImage img) + { + synchronized (bytemap) + { + while (bytesize > 1000 * 1000 * 50) + { + URI olduri = bytemapAccessQueue.removeFirst(); + byte[] oldbimg = bytemap.remove(olduri); + bytesize -= oldbimg.length; + log("removed 1 img from byte cache"); + } + + bytemap.put(uri, bimg); + bytesize += bimg.length; + bytemapAccessQueue.addLast(uri); + } + addToImageCache(uri, img); + } + + /** + * Returns a buffered image for the requested URI from the cache. This method must return null if the image is not + * in the cache. If the image is unavailable but it's compressed version *is* available, then the compressed version + * will be expanded and returned. + * @param uri URI of the image previously put in the cache + * @return the image matching the requested URI, or null if not available + * @throws IOException if retrieval fails + */ + public BufferedImage get(URI uri) throws IOException + { + synchronized (imgmap) + { + if (imgmap.containsKey(uri)) + { + imgmapAccessQueue.remove(uri); + imgmapAccessQueue.addLast(uri); + return imgmap.get(uri); + } + } + synchronized (bytemap) + { + if (bytemap.containsKey(uri)) + { + log("retrieving from bytes"); + bytemapAccessQueue.remove(uri); + bytemapAccessQueue.addLast(uri); + BufferedImage img = ImageIO.read(new ByteArrayInputStream(bytemap.get(uri))); + addToImageCache(uri, img); + return img; + } + } + return null; + } + + /** + * Request that the cache free up some memory. How this happens or how much memory is freed is up to the TileCache + * implementation. Subclasses can implement their own strategy. The default strategy is to clear out all buffered + * images but retain the compressed versions. + */ + public void needMoreMemory() + { + imgmap.clear(); + log("HACK! need more memory: freeing up memory"); + } + + private void addToImageCache(final URI uri, final BufferedImage img) + { + synchronized (imgmap) + { + try { + while (imagesize > 1000 * 1000 * 50) + { + URI olduri = imgmapAccessQueue.removeFirst(); + BufferedImage oldimg = imgmap.remove(olduri); + imagesize -= oldimg.getWidth() * oldimg.getHeight() * 4; + log("removed 1 img from image cache"); + } + imgmap.put(uri, img); + imagesize += img.getWidth() * img.getHeight() * 4; + imgmapAccessQueue.addLast(uri); + } catch (Exception ex) { + log("Failed to load tile at URL. Tile is null"); + } + } +// log("added to cache: " + " uncompressed = " + imgmap.keySet().size() + " / " + imagesize / 1000 + "k" +// + " compressed = " + bytemap.keySet().size() + " / " + bytesize / 1000 + "k"); + } + + private void log(String string) + { +// Log.debug( string ); + } + +} diff --git a/src/org/jdesktop/swingx/mapviewer/TileFactory.java b/src/main/java/org/jdesktop/swingx/mapviewer/TileFactory.java similarity index 95% rename from src/org/jdesktop/swingx/mapviewer/TileFactory.java rename to src/main/java/org/jdesktop/swingx/mapviewer/TileFactory.java index c1eba196..8e5fb5f1 100644 --- a/src/org/jdesktop/swingx/mapviewer/TileFactory.java +++ b/src/main/java/org/jdesktop/swingx/mapviewer/TileFactory.java @@ -1,144 +1,144 @@ -/* - * TileFactory.java - * - * Created on March 17, 2006, 8:01 PM - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package org.jdesktop.swingx.mapviewer; - -import java.awt.Dimension; -import java.awt.geom.Point2D; -import java.util.ArrayList; -import java.util.List; - -import org.jdesktop.swingx.mapviewer.util.GeoUtil; - -/** - * A class that can produce tiles and convert coordinates to pixels - * @author joshy - */ -public abstract class TileFactory -{ - private TileFactoryInfo info; - private List tileListeners = new ArrayList(); - - /** - * Creates a new instance of TileFactory - * @param info a TileFactoryInfo to configure this TileFactory - */ - protected TileFactory(TileFactoryInfo info) - { - this.info = info; - } - - /** - * Gets the size of an edge of a tile in pixels at the current zoom level. Tiles must be square. - * @param zoom the current zoom level - * @return the size of an edge of a tile in pixels - */ - public int getTileSize(int zoom) - { - return getInfo().getTileSize(zoom); - } - - /** - * Returns a Dimension containing the width and height of the map, in tiles at the current zoom level. So a - * Dimension that returns 10x20 would be 10 tiles wide and 20 tiles tall. These values can be multipled by - * getTileSize() to determine the pixel width/height for the map at the given zoom level - * @return the size of the world bitmap in tiles - * @param zoom the current zoom level - */ - public Dimension getMapSize(int zoom) - { - return GeoUtil.getMapSize(zoom, getInfo()); - } - - /** - * Return the Tile at a given TilePoint and zoom level - * @return the tile that is located at the given tilePoint for this zoom level. For example, if getMapSize() returns - * 10x20 for this zoom, and the tilePoint is (3,5), then the appropriate tile will be located and returned. This - * method must not return null. However, it can return dummy tiles that contain no data if it wants. This is - * appropriate, for example, for tiles which are outside of the bounds of the map and if the factory doesn't - * implement wrapping. - * @param x the x value - * @param y the y value - * @param zoom the current zoom level - */ - public abstract Tile getTile(int x, int y, int zoom); - - /** - * Convert a pixel in the world bitmap at the specified zoom level into a GeoPosition - * @param pixelCoordinate a Point2D representing a pixel in the world bitmap - * @param zoom the zoom level of the world bitmap - * @return the converted GeoPosition - */ - public GeoPosition pixelToGeo(Point2D pixelCoordinate, int zoom) - { - return GeoUtil.getPosition(pixelCoordinate, zoom, getInfo()); - } - - /** - * Convert a GeoPosition to a pixel position in the world bitmap a the specified zoom level. - * @param c a GeoPosition - * @param zoomLevel the zoom level to extract the pixel coordinate for - * @return the pixel point - */ - public Point2D geoToPixel(GeoPosition c, int zoomLevel) - { - return GeoUtil.getBitmapCoordinate(c, zoomLevel, getInfo()); - } - - /** - * Get the TileFactoryInfo describing this TileFactory - * @return a TileFactoryInfo - */ - public TileFactoryInfo getInfo() - { - return info; - } - - /** - * Adds a tile listener - * @param listener the listener - */ - public void addTileListener(TileListener listener) - { - tileListeners.add(listener); - } - - /** - * Removes a tile listener - * @param listener the listener - */ - public void removeTileListener(TileListener listener) - { - tileListeners.remove(listener); - } - - /** - * Disposes this TileFactory - */ - public abstract void dispose(); - - /** - * Notifies all tile listeners - * @param tile the tile - */ - protected void fireTileLoadedEvent(Tile tile) - { - for (TileListener listener : tileListeners) - { - listener.tileLoaded(tile); - } - } - - /** - * Override this method to load the tile using, for example, an ExecutorService. - * @param tile The tile to load. - */ - protected abstract void startLoading(Tile tile); - -} +/* + * TileFactory.java + * + * Created on March 17, 2006, 8:01 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package org.jdesktop.swingx.mapviewer; + +import org.jdesktop.swingx.mapviewer.util.GeoUtil; + +import java.awt.*; +import java.awt.geom.Point2D; +import java.util.ArrayList; +import java.util.List; + +/** + * A class that can produce tiles and convert coordinates to pixels + * @author joshy + */ +public abstract class TileFactory +{ + private TileFactoryInfo info; + private List tileListeners = new ArrayList(); + + /** + * Creates a new instance of TileFactory + * @param info a TileFactoryInfo to configure this TileFactory + */ + protected TileFactory(TileFactoryInfo info) + { + this.info = info; + } + + /** + * Gets the size of an edge of a tile in pixels at the current zoom level. Tiles must be square. + * @param zoom the current zoom level + * @return the size of an edge of a tile in pixels + */ + public int getTileSize(int zoom) + { + return getInfo().getTileSize(zoom); + } + + /** + * Returns a Dimension containing the width and height of the map, in tiles at the current zoom level. So a + * Dimension that returns 10x20 would be 10 tiles wide and 20 tiles tall. These values can be multipled by + * getTileSize() to determine the pixel width/height for the map at the given zoom level + * @return the size of the world bitmap in tiles + * @param zoom the current zoom level + */ + public Dimension getMapSize(int zoom) + { + return GeoUtil.getMapSize(zoom, getInfo()); + } + + /** + * Return the Tile at a given TilePoint and zoom level + * @return the tile that is located at the given tilePoint for this zoom level. For example, if getMapSize() returns + * 10x20 for this zoom, and the tilePoint is (3,5), then the appropriate tile will be located and returned. This + * method must not return null. However, it can return dummy tiles that contain no data if it wants. This is + * appropriate, for example, for tiles which are outside of the bounds of the map and if the factory doesn't + * implement wrapping. + * @param x the x value + * @param y the y value + * @param zoom the current zoom level + */ + public abstract Tile getTile(int x, int y, int zoom); + + /** + * Convert a pixel in the world bitmap at the specified zoom level into a GeoPosition + * @param pixelCoordinate a Point2D representing a pixel in the world bitmap + * @param zoom the zoom level of the world bitmap + * @return the converted GeoPosition + */ + public GeoPosition pixelToGeo(Point2D pixelCoordinate, int zoom) + { + return GeoUtil.getPosition(pixelCoordinate, zoom, getInfo()); + } + + /** + * Convert a GeoPosition to a pixel position in the world bitmap a the specified zoom level. + * @param c a GeoPosition + * @param zoomLevel the zoom level to extract the pixel coordinate for + * @return the pixel point + */ + public Point2D geoToPixel(GeoPosition c, int zoomLevel) + { + return GeoUtil.getBitmapCoordinate(c, zoomLevel, getInfo()); + } + + /** + * Get the TileFactoryInfo describing this TileFactory + * @return a TileFactoryInfo + */ + public TileFactoryInfo getInfo() + { + return info; + } + + /** + * Adds a tile listener + * @param listener the listener + */ + public void addTileListener(TileListener listener) + { + tileListeners.add(listener); + } + + /** + * Removes a tile listener + * @param listener the listener + */ + public void removeTileListener(TileListener listener) + { + tileListeners.remove(listener); + } + + /** + * Disposes this TileFactory + */ + public abstract void dispose(); + + /** + * Notifies all tile listeners + * @param tile the tile + */ + protected void fireTileLoadedEvent(Tile tile) + { + for (TileListener listener : tileListeners) + { + listener.tileLoaded(tile); + } + } + + /** + * Override this method to load the tile using, for example, an ExecutorService. + * @param tile The tile to load. + */ + protected abstract void startLoading(Tile tile); + +} diff --git a/src/org/jdesktop/swingx/mapviewer/TileFactoryInfo.java b/src/main/java/org/jdesktop/swingx/mapviewer/TileFactoryInfo.java similarity index 100% rename from src/org/jdesktop/swingx/mapviewer/TileFactoryInfo.java rename to src/main/java/org/jdesktop/swingx/mapviewer/TileFactoryInfo.java diff --git a/src/org/jdesktop/swingx/mapviewer/TileListener.java b/src/main/java/org/jdesktop/swingx/mapviewer/TileListener.java similarity index 100% rename from src/org/jdesktop/swingx/mapviewer/TileListener.java rename to src/main/java/org/jdesktop/swingx/mapviewer/TileListener.java diff --git a/src/org/jdesktop/swingx/mapviewer/Waypoint.java b/src/main/java/org/jdesktop/swingx/mapviewer/Waypoint.java similarity index 95% rename from src/org/jdesktop/swingx/mapviewer/Waypoint.java rename to src/main/java/org/jdesktop/swingx/mapviewer/Waypoint.java index 9666dc2a..b5c06033 100644 --- a/src/org/jdesktop/swingx/mapviewer/Waypoint.java +++ b/src/main/java/org/jdesktop/swingx/mapviewer/Waypoint.java @@ -1,25 +1,25 @@ -/* - * Waypoint.java - * - * Created on March 30, 2006, 5:22 PM - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package org.jdesktop.swingx.mapviewer; - - -/** - * A Waypoint is a GeoPosition that can be - * drawn on a may using a WaypointPainter. - * @author joshy - */ -public interface Waypoint -{ - /** - * Get the current GeoPosition of this Waypoint - * @return the current position - */ - public GeoPosition getPosition(); -} +/* + * Waypoint.java + * + * Created on March 30, 2006, 5:22 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package org.jdesktop.swingx.mapviewer; + + +/** + * A Waypoint is a GeoPosition that can be + * drawn on a may using a WaypointPainter. + * @author joshy + */ +public interface Waypoint +{ + /** + * Get the current GeoPosition of this Waypoint + * @return the current position + */ + public GeoPosition getPosition(); +} diff --git a/src/org/jdesktop/swingx/mapviewer/WaypointPainter.java b/src/main/java/org/jdesktop/swingx/mapviewer/WaypointPainter.java similarity index 92% rename from src/org/jdesktop/swingx/mapviewer/WaypointPainter.java rename to src/main/java/org/jdesktop/swingx/mapviewer/WaypointPainter.java index cd4fe88a..f5f0319b 100644 --- a/src/org/jdesktop/swingx/mapviewer/WaypointPainter.java +++ b/src/main/java/org/jdesktop/swingx/mapviewer/WaypointPainter.java @@ -1,90 +1,89 @@ -/* - * WaypointMapOverlay.java - * - * Created on April 1, 2006, 4:59 PM - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package org.jdesktop.swingx.mapviewer; - -import java.awt.Graphics2D; -import java.awt.Rectangle; -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - -import org.jdesktop.swingx.JXMapViewer; -import org.jdesktop.swingx.painter.AbstractPainter; - -/** - * Paints waypoints on the JXMapViewer. This is an - * instance of Painter that only can draw on to JXMapViewers. - * @param the waypoint type - * @author rbair - */ -public class WaypointPainter extends AbstractPainter -{ - private WaypointRenderer renderer = new DefaultWaypointRenderer(); - private Set waypoints = new HashSet(); - - /** - * Creates a new instance of WaypointPainter - */ - public WaypointPainter() - { - setAntialiasing(true); - setCacheable(false); - } - - /** - * Sets the waypoint renderer to use when painting waypoints - * @param r the new WaypointRenderer to use - */ - public void setRenderer(WaypointRenderer r) - { - this.renderer = r; - } - - /** - * Gets the current set of waypoints to paint - * @return a typed Set of Waypoints - */ - public Set getWaypoints() - { - return Collections.unmodifiableSet(waypoints); - } - - /** - * Sets the current set of waypoints to paint - * @param waypoints the new Set of Waypoints to use - */ - public void setWaypoints(Set waypoints) - { - this.waypoints.clear(); - this.waypoints.addAll(waypoints); - } - - @Override - protected void doPaint(Graphics2D g, JXMapViewer map, int width, int height) - { - if (renderer == null) - { - return; - } - - Rectangle viewportBounds = map.getViewportBounds(); - - g.translate(-viewportBounds.getX(), -viewportBounds.getY()); - - for (W w : getWaypoints()) - { - renderer.paintWaypoint(g, map, w); - } - - g.translate(viewportBounds.getX(), viewportBounds.getY()); - - } - -} +/* + * WaypointMapOverlay.java + * + * Created on April 1, 2006, 4:59 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package org.jdesktop.swingx.mapviewer; + +import org.jdesktop.swingx.JXMapViewer; +import org.jdesktop.swingx.painter.AbstractPainter; + +import java.awt.*; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +/** + * Paints waypoints on the JXMapViewer. This is an + * instance of Painter that only can draw on to JXMapViewers. + * @param the waypoint type + * @author rbair + */ +public class WaypointPainter extends AbstractPainter +{ + private WaypointRenderer renderer = new DefaultWaypointRenderer(); + private Set waypoints = new HashSet(); + + /** + * Creates a new instance of WaypointPainter + */ + public WaypointPainter() + { + setAntialiasing(true); + setCacheable(false); + } + + /** + * Sets the waypoint renderer to use when painting waypoints + * @param r the new WaypointRenderer to use + */ + public void setRenderer(WaypointRenderer r) + { + this.renderer = r; + } + + /** + * Gets the current set of waypoints to paint + * @return a typed Set of Waypoints + */ + public Set getWaypoints() + { + return Collections.unmodifiableSet(waypoints); + } + + /** + * Sets the current set of waypoints to paint + * @param waypoints the new Set of Waypoints to use + */ + public void setWaypoints(Set waypoints) + { + this.waypoints.clear(); + this.waypoints.addAll(waypoints); + } + + @Override + protected void doPaint(Graphics2D g, JXMapViewer map, int width, int height) + { + if (renderer == null) + { + return; + } + + Rectangle viewportBounds = map.getViewportBounds(); + + g.translate(-viewportBounds.getX(), -viewportBounds.getY()); + + for (W w : getWaypoints()) + { + renderer.paintWaypoint(g, map, w); + } + + g.translate(viewportBounds.getX(), viewportBounds.getY()); + + } + +} diff --git a/src/org/jdesktop/swingx/mapviewer/WaypointRenderer.java b/src/main/java/org/jdesktop/swingx/mapviewer/WaypointRenderer.java similarity index 92% rename from src/org/jdesktop/swingx/mapviewer/WaypointRenderer.java rename to src/main/java/org/jdesktop/swingx/mapviewer/WaypointRenderer.java index c20f7a00..4b72cdfd 100644 --- a/src/org/jdesktop/swingx/mapviewer/WaypointRenderer.java +++ b/src/main/java/org/jdesktop/swingx/mapviewer/WaypointRenderer.java @@ -1,32 +1,32 @@ -/* - * WaypointRenderer.java - * - * Created on March 30, 2006, 5:56 PM - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package org.jdesktop.swingx.mapviewer; - -import java.awt.Graphics2D; - -import org.jdesktop.swingx.JXMapViewer; - -/** - * A interface that draws waypoints. Implementations of WaypointRenderer can - * be set on a WayPointPainter to draw waypoints on a JXMapViewer - * @param the waypoint type - * @author joshua.marinacci@sun.com - */ -public interface WaypointRenderer -{ - /** - * paint the specified waypoint on the specified map and graphics context - * @param g the graphics2D object - * @param map the map - * @param waypoint the waypoint - */ - public void paintWaypoint(Graphics2D g, JXMapViewer map, W waypoint); - -} +/* + * WaypointRenderer.java + * + * Created on March 30, 2006, 5:56 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package org.jdesktop.swingx.mapviewer; + +import org.jdesktop.swingx.JXMapViewer; + +import java.awt.*; + +/** + * A interface that draws waypoints. Implementations of WaypointRenderer can + * be set on a WayPointPainter to draw waypoints on a JXMapViewer + * @param the waypoint type + * @author joshua.marinacci@sun.com + */ +public interface WaypointRenderer +{ + /** + * paint the specified waypoint on the specified map and graphics context + * @param g the graphics2D object + * @param map the map + * @param waypoint the waypoint + */ + public void paintWaypoint(Graphics2D g, JXMapViewer map, W waypoint); + +} diff --git a/src/org/jdesktop/swingx/mapviewer/bmng/CylindricalProjectionTileFactory.java b/src/main/java/org/jdesktop/swingx/mapviewer/bmng/CylindricalProjectionTileFactory.java similarity index 99% rename from src/org/jdesktop/swingx/mapviewer/bmng/CylindricalProjectionTileFactory.java rename to src/main/java/org/jdesktop/swingx/mapviewer/bmng/CylindricalProjectionTileFactory.java index b4864b6d..8d10f153 100644 --- a/src/org/jdesktop/swingx/mapviewer/bmng/CylindricalProjectionTileFactory.java +++ b/src/main/java/org/jdesktop/swingx/mapviewer/bmng/CylindricalProjectionTileFactory.java @@ -17,12 +17,12 @@ ******************************************************************************/ package org.jdesktop.swingx.mapviewer.bmng; -import java.awt.Dimension; -import java.awt.geom.Point2D; - import org.jdesktop.swingx.mapviewer.DefaultTileFactory; import org.jdesktop.swingx.mapviewer.GeoPosition; +import java.awt.*; +import java.awt.geom.Point2D; + /** * @author joshy */ diff --git a/src/org/jdesktop/swingx/mapviewer/bmng/SLMapServerInfo.java b/src/main/java/org/jdesktop/swingx/mapviewer/bmng/SLMapServerInfo.java similarity index 100% rename from src/org/jdesktop/swingx/mapviewer/bmng/SLMapServerInfo.java rename to src/main/java/org/jdesktop/swingx/mapviewer/bmng/SLMapServerInfo.java diff --git a/src/org/jdesktop/swingx/mapviewer/empty/EmptyTileFactory.java b/src/main/java/org/jdesktop/swingx/mapviewer/empty/EmptyTileFactory.java similarity index 92% rename from src/org/jdesktop/swingx/mapviewer/empty/EmptyTileFactory.java rename to src/main/java/org/jdesktop/swingx/mapviewer/empty/EmptyTileFactory.java index 596fc0af..4470cf9e 100644 --- a/src/org/jdesktop/swingx/mapviewer/empty/EmptyTileFactory.java +++ b/src/main/java/org/jdesktop/swingx/mapviewer/empty/EmptyTileFactory.java @@ -1,103 +1,101 @@ -/* - * EmptyTileFactory.java - * - * Created on June 7, 2006, 4:58 PM - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package org.jdesktop.swingx.mapviewer.empty; - -import java.awt.Color; -import java.awt.Graphics2D; -import java.awt.RenderingHints; -import java.awt.image.BufferedImage; - -import org.jdesktop.swingx.mapviewer.Tile; -import org.jdesktop.swingx.mapviewer.TileFactory; -import org.jdesktop.swingx.mapviewer.TileFactoryInfo; - -/** - * A null implementation of TileFactory. Draws empty areas. - * @author joshy - */ -public class EmptyTileFactory extends TileFactory -{ - /** - * The empty tile image. - */ - private BufferedImage emptyTile; - - /** - * Creates a new instance of EmptyTileFactory - */ - public EmptyTileFactory() - { - this(new TileFactoryInfo("EmptyTileFactory 256x256", 1, 15, 17, 256, true, true, "", "x", "y", "z")); - } - - /** - * Creates a new instance of EmptyTileFactory using the specified info. - * @param info the tile factory info - */ - public EmptyTileFactory(TileFactoryInfo info) - { - super(info); - int tileSize = info.getTileSize(info.getMinimumZoomLevel()); - emptyTile = new BufferedImage(tileSize, tileSize, BufferedImage.TYPE_INT_ARGB); - Graphics2D g = emptyTile.createGraphics(); - g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - g.setColor(Color.GRAY); - g.fillRect(0, 0, tileSize, tileSize); - g.setColor(Color.WHITE); - g.drawOval(10, 10, tileSize - 20, tileSize - 20); - g.fillOval(70, 50, 20, 20); - g.fillOval(tileSize - 90, 50, 20, 20); - g.fillOval(tileSize / 2 - 10, tileSize / 2 - 10, 20, 20); - g.dispose(); - } - - /** - * Gets an instance of an empty tile for the given tile position and zoom on the world map. - * @param x The tile's x position on the world map. - * @param y The tile's y position on the world map. - * @param zoom The current zoom level. - */ - @Override - public Tile getTile(int x, int y, int zoom) - { - return new Tile(x, y, zoom) - { - @Override - public synchronized boolean isLoaded() - { - return true; - } - - @Override - public BufferedImage getImage() - { - return emptyTile; - } - - }; - } - - @Override - public void dispose() - { - // noop - } - - /** - * Override this method to load the tile using, for example, an ExecutorService. - * @param tile The tile to load. - */ - @Override - protected void startLoading(Tile tile) - { - // noop - } - -} +/* + * EmptyTileFactory.java + * + * Created on June 7, 2006, 4:58 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package org.jdesktop.swingx.mapviewer.empty; + +import org.jdesktop.swingx.mapviewer.Tile; +import org.jdesktop.swingx.mapviewer.TileFactory; +import org.jdesktop.swingx.mapviewer.TileFactoryInfo; + +import java.awt.*; +import java.awt.image.BufferedImage; + +/** + * A null implementation of TileFactory. Draws empty areas. + * @author joshy + */ +public class EmptyTileFactory extends TileFactory +{ + /** + * The empty tile image. + */ + private BufferedImage emptyTile; + + /** + * Creates a new instance of EmptyTileFactory + */ + public EmptyTileFactory() + { + this(new TileFactoryInfo("EmptyTileFactory 256x256", 1, 15, 17, 256, true, true, "", "x", "y", "z")); + } + + /** + * Creates a new instance of EmptyTileFactory using the specified info. + * @param info the tile factory info + */ + public EmptyTileFactory(TileFactoryInfo info) + { + super(info); + int tileSize = info.getTileSize(info.getMinimumZoomLevel()); + emptyTile = new BufferedImage(tileSize, tileSize, BufferedImage.TYPE_INT_ARGB); + Graphics2D g = emptyTile.createGraphics(); + g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + g.setColor(Color.GRAY); + g.fillRect(0, 0, tileSize, tileSize); + g.setColor(Color.WHITE); + g.drawOval(10, 10, tileSize - 20, tileSize - 20); + g.fillOval(70, 50, 20, 20); + g.fillOval(tileSize - 90, 50, 20, 20); + g.fillOval(tileSize / 2 - 10, tileSize / 2 - 10, 20, 20); + g.dispose(); + } + + /** + * Gets an instance of an empty tile for the given tile position and zoom on the world map. + * @param x The tile's x position on the world map. + * @param y The tile's y position on the world map. + * @param zoom The current zoom level. + */ + @Override + public Tile getTile(int x, int y, int zoom) + { + return new Tile(x, y, zoom) + { + @Override + public synchronized boolean isLoaded() + { + return true; + } + + @Override + public BufferedImage getImage() + { + return emptyTile; + } + + }; + } + + @Override + public void dispose() + { + // noop + } + + /** + * Override this method to load the tile using, for example, an ExecutorService. + * @param tile The tile to load. + */ + @Override + protected void startLoading(Tile tile) + { + // noop + } + +} diff --git a/src/org/jdesktop/swingx/mapviewer/esri/ESRITileFactory.java b/src/main/java/org/jdesktop/swingx/mapviewer/esri/ESRITileFactory.java similarity index 100% rename from src/org/jdesktop/swingx/mapviewer/esri/ESRITileFactory.java rename to src/main/java/org/jdesktop/swingx/mapviewer/esri/ESRITileFactory.java index b4f0290b..0fe2d038 100644 --- a/src/org/jdesktop/swingx/mapviewer/esri/ESRITileFactory.java +++ b/src/main/java/org/jdesktop/swingx/mapviewer/esri/ESRITileFactory.java @@ -9,15 +9,15 @@ package org.jdesktop.swingx.mapviewer.esri; -import java.awt.geom.Point2D; -import java.math.BigDecimal; -import java.math.RoundingMode; - import org.jdesktop.swingx.mapviewer.DefaultTileFactory; import org.jdesktop.swingx.mapviewer.GeoPosition; import org.jdesktop.swingx.mapviewer.TileFactoryInfo; import org.jdesktop.swingx.mapviewer.util.GeoUtil; +import java.awt.geom.Point2D; +import java.math.BigDecimal; +import java.math.RoundingMode; + /** * @author rbair */ diff --git a/src/org/jdesktop/swingx/mapviewer/resources/loading.png b/src/main/java/org/jdesktop/swingx/mapviewer/resources/loading.png similarity index 100% rename from src/org/jdesktop/swingx/mapviewer/resources/loading.png rename to src/main/java/org/jdesktop/swingx/mapviewer/resources/loading.png diff --git a/src/org/jdesktop/swingx/mapviewer/resources/minus.png b/src/main/java/org/jdesktop/swingx/mapviewer/resources/minus.png similarity index 100% rename from src/org/jdesktop/swingx/mapviewer/resources/minus.png rename to src/main/java/org/jdesktop/swingx/mapviewer/resources/minus.png diff --git a/src/org/jdesktop/swingx/mapviewer/resources/plus.png b/src/main/java/org/jdesktop/swingx/mapviewer/resources/plus.png similarity index 100% rename from src/org/jdesktop/swingx/mapviewer/resources/plus.png rename to src/main/java/org/jdesktop/swingx/mapviewer/resources/plus.png diff --git a/src/org/jdesktop/swingx/mapviewer/resources/standard_waypoint.png b/src/main/java/org/jdesktop/swingx/mapviewer/resources/standard_waypoint.png similarity index 100% rename from src/org/jdesktop/swingx/mapviewer/resources/standard_waypoint.png rename to src/main/java/org/jdesktop/swingx/mapviewer/resources/standard_waypoint.png diff --git a/src/org/jdesktop/swingx/mapviewer/util/GeoUtil.java b/src/main/java/org/jdesktop/swingx/mapviewer/util/GeoUtil.java similarity index 96% rename from src/org/jdesktop/swingx/mapviewer/util/GeoUtil.java rename to src/main/java/org/jdesktop/swingx/mapviewer/util/GeoUtil.java index ac1e21de..36dbf53f 100644 --- a/src/org/jdesktop/swingx/mapviewer/util/GeoUtil.java +++ b/src/main/java/org/jdesktop/swingx/mapviewer/util/GeoUtil.java @@ -1,167 +1,167 @@ -/* - * GeoUtil.java - * - * Created on June 26, 2006, 10:44 AM - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package org.jdesktop.swingx.mapviewer.util; - -import java.awt.Dimension; -import java.awt.geom.Point2D; -import java.awt.geom.Rectangle2D; -import java.util.HashSet; -import java.util.Set; - -import org.jdesktop.swingx.JXMapViewer; -import org.jdesktop.swingx.mapviewer.GeoBounds; -import org.jdesktop.swingx.mapviewer.GeoPosition; -import org.jdesktop.swingx.mapviewer.TileFactory; -import org.jdesktop.swingx.mapviewer.TileFactoryInfo; - -/** - * These are math utilities for converting between pixels, tiles, and geographic coordinates. Implements a Google Maps - * style mercator projection. - * @author joshy - */ -public final class GeoUtil -{ - /** - * @param zoom the zoom level - * @param info the tile factory info - * @return the size of the map at the given zoom, in tiles (num tiles tall by num tiles wide) - */ - public static Dimension getMapSize(int zoom, TileFactoryInfo info) - { - return new Dimension(info.getMapWidthInTilesAtZoom(zoom), info.getMapWidthInTilesAtZoom(zoom)); - } - - /** - * @param x the x value - * @param y the y value - * @param zoomLevel the zoom level - * @param info the tile factory info - * @return true if this point in tiles is valid at this zoom level. For example, if the zoom level is 0 - * (zoomed all the way out, where there is only one tile), then x,y must be 0,0 - */ - public static boolean isValidTile(int x, int y, int zoomLevel, TileFactoryInfo info) - { - // int x = (int)coord.getX(); - // int y = (int)coord.getY(); - // if off the map to the top or left - if (x < 0 || y < 0) - { - return false; - } - // if of the map to the right - if (info.getMapCenterInPixelsAtZoom(zoomLevel).getX() * 2 <= x * info.getTileSize(zoomLevel)) - { - return false; - } - // if off the map to the bottom - if (info.getMapCenterInPixelsAtZoom(zoomLevel).getY() * 2 <= y * info.getTileSize(zoomLevel)) - { - return false; - } - // if out of zoom bounds - if (zoomLevel < info.getMinimumZoomLevel() || zoomLevel > info.getMaximumZoomLevel()) - { - return false; - } - return true; - } - - /** - * Given a position (latitude/longitude pair) and a zoom level, return the appropriate point in pixels. The - * zoom level is necessary because pixel coordinates are in terms of the zoom level - * @param c A lat/lon pair - * @param zoomLevel the zoom level to extract the pixel coordinate for - * @param info the tile factory info - * @return the coordinate - */ - public static Point2D getBitmapCoordinate(GeoPosition c, int zoomLevel, TileFactoryInfo info) - { - return getBitmapCoordinate(c.getLatitude(), c.getLongitude(), zoomLevel, info); - } - - /** - * Given a position (latitude/longitude pair) and a zoom level, return the appropriate point in pixels. The - * zoom level is necessary because pixel coordinates are in terms of the zoom level - * @param latitude the latitude - * @param longitude the longitude - * @param zoomLevel the zoom level to extract the pixel coordinate for - * @param info the tile factory info - * @return the coordinate - */ - public static Point2D getBitmapCoordinate(double latitude, double longitude, int zoomLevel, TileFactoryInfo info) - { - double x = info.getMapCenterInPixelsAtZoom(zoomLevel).getX() + longitude - * info.getLongitudeDegreeWidthInPixels(zoomLevel); - double e = Math.sin(latitude * (Math.PI / 180.0)); - if (e > 0.9999) - { - e = 0.9999; - } - if (e < -0.9999) - { - e = -0.9999; - } - double y = info.getMapCenterInPixelsAtZoom(zoomLevel).getY() + 0.5 * Math.log((1 + e) / (1 - e)) * -1 - * (info.getLongitudeRadianWidthInPixels(zoomLevel)); - return new Point2D.Double(x, y); - } - - /** - * Convert an on screen pixel coordinate and a zoom level to a geo position - * @param pixelCoordinate the coordinate in pixels - * @param zoom the zoom level - * @param info the tile factory info - * @return a geo position - */ - public static GeoPosition getPosition(Point2D pixelCoordinate, int zoom, TileFactoryInfo info) - { - // p(" --bitmap to latlon : " + coord + " " + zoom); - double wx = pixelCoordinate.getX(); - double wy = pixelCoordinate.getY(); - // this reverses getBitmapCoordinates - double flon = (wx - info.getMapCenterInPixelsAtZoom(zoom).getX()) / info.getLongitudeDegreeWidthInPixels(zoom); - double e1 = (wy - info.getMapCenterInPixelsAtZoom(zoom).getY()) - / (-1 * info.getLongitudeRadianWidthInPixels(zoom)); - double e2 = (2 * Math.atan(Math.exp(e1)) - Math.PI / 2) / (Math.PI / 180.0); - double flat = e2; - GeoPosition wc = new GeoPosition(flat, flon); - return wc; - } - - /** - * Gets the map bounds. - * @param mapViewer The map viewer. - * @return Returns the bounds. - */ - public static GeoBounds getMapBounds(JXMapViewer mapViewer) - { - return new GeoBounds(getMapGeoBounds(mapViewer)); - } - - /** - * Gets the bounds as a set of two GeoPosition objects. - * @param mapViewer The map viewer. - * @return Returns the set of two GeoPosition objects that represent the north west and south east - * corners of the map. - */ - private static Set getMapGeoBounds(JXMapViewer mapViewer) - { - Set set = new HashSet(); - TileFactory tileFactory = mapViewer.getTileFactory(); - int zoom = mapViewer.getZoom(); - Rectangle2D bounds = mapViewer.getViewportBounds(); - Point2D pt = new Point2D.Double(bounds.getX(), bounds.getY()); - set.add(tileFactory.pixelToGeo(pt, zoom)); - pt = new Point2D.Double(bounds.getX() + bounds.getWidth(), bounds.getY() + bounds.getHeight()); - set.add(tileFactory.pixelToGeo(pt, zoom)); - return set; - } - -} +/* + * GeoUtil.java + * + * Created on June 26, 2006, 10:44 AM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package org.jdesktop.swingx.mapviewer.util; + +import org.jdesktop.swingx.JXMapViewer; +import org.jdesktop.swingx.mapviewer.GeoBounds; +import org.jdesktop.swingx.mapviewer.GeoPosition; +import org.jdesktop.swingx.mapviewer.TileFactory; +import org.jdesktop.swingx.mapviewer.TileFactoryInfo; + +import java.awt.*; +import java.awt.geom.Point2D; +import java.awt.geom.Rectangle2D; +import java.util.HashSet; +import java.util.Set; + +/** + * These are math utilities for converting between pixels, tiles, and geographic coordinates. Implements a Google Maps + * style mercator projection. + * @author joshy + */ +public final class GeoUtil +{ + /** + * @param zoom the zoom level + * @param info the tile factory info + * @return the size of the map at the given zoom, in tiles (num tiles tall by num tiles wide) + */ + public static Dimension getMapSize(int zoom, TileFactoryInfo info) + { + return new Dimension(info.getMapWidthInTilesAtZoom(zoom), info.getMapWidthInTilesAtZoom(zoom)); + } + + /** + * @param x the x value + * @param y the y value + * @param zoomLevel the zoom level + * @param info the tile factory info + * @return true if this point in tiles is valid at this zoom level. For example, if the zoom level is 0 + * (zoomed all the way out, where there is only one tile), then x,y must be 0,0 + */ + public static boolean isValidTile(int x, int y, int zoomLevel, TileFactoryInfo info) + { + // int x = (int)coord.getX(); + // int y = (int)coord.getY(); + // if off the map to the top or left + if (x < 0 || y < 0) + { + return false; + } + // if of the map to the right + if (info.getMapCenterInPixelsAtZoom(zoomLevel).getX() * 2 <= x * info.getTileSize(zoomLevel)) + { + return false; + } + // if off the map to the bottom + if (info.getMapCenterInPixelsAtZoom(zoomLevel).getY() * 2 <= y * info.getTileSize(zoomLevel)) + { + return false; + } + // if out of zoom bounds + if (zoomLevel < info.getMinimumZoomLevel() || zoomLevel > info.getMaximumZoomLevel()) + { + return false; + } + return true; + } + + /** + * Given a position (latitude/longitude pair) and a zoom level, return the appropriate point in pixels. The + * zoom level is necessary because pixel coordinates are in terms of the zoom level + * @param c A lat/lon pair + * @param zoomLevel the zoom level to extract the pixel coordinate for + * @param info the tile factory info + * @return the coordinate + */ + public static Point2D getBitmapCoordinate(GeoPosition c, int zoomLevel, TileFactoryInfo info) + { + return getBitmapCoordinate(c.getLatitude(), c.getLongitude(), zoomLevel, info); + } + + /** + * Given a position (latitude/longitude pair) and a zoom level, return the appropriate point in pixels. The + * zoom level is necessary because pixel coordinates are in terms of the zoom level + * @param latitude the latitude + * @param longitude the longitude + * @param zoomLevel the zoom level to extract the pixel coordinate for + * @param info the tile factory info + * @return the coordinate + */ + public static Point2D getBitmapCoordinate(double latitude, double longitude, int zoomLevel, TileFactoryInfo info) + { + double x = info.getMapCenterInPixelsAtZoom(zoomLevel).getX() + longitude + * info.getLongitudeDegreeWidthInPixels(zoomLevel); + double e = Math.sin(latitude * (Math.PI / 180.0)); + if (e > 0.9999) + { + e = 0.9999; + } + if (e < -0.9999) + { + e = -0.9999; + } + double y = info.getMapCenterInPixelsAtZoom(zoomLevel).getY() + 0.5 * Math.log((1 + e) / (1 - e)) * -1 + * (info.getLongitudeRadianWidthInPixels(zoomLevel)); + return new Point2D.Double(x, y); + } + + /** + * Convert an on screen pixel coordinate and a zoom level to a geo position + * @param pixelCoordinate the coordinate in pixels + * @param zoom the zoom level + * @param info the tile factory info + * @return a geo position + */ + public static GeoPosition getPosition(Point2D pixelCoordinate, int zoom, TileFactoryInfo info) + { + // p(" --bitmap to latlon : " + coord + " " + zoom); + double wx = pixelCoordinate.getX(); + double wy = pixelCoordinate.getY(); + // this reverses getBitmapCoordinates + double flon = (wx - info.getMapCenterInPixelsAtZoom(zoom).getX()) / info.getLongitudeDegreeWidthInPixels(zoom); + double e1 = (wy - info.getMapCenterInPixelsAtZoom(zoom).getY()) + / (-1 * info.getLongitudeRadianWidthInPixels(zoom)); + double e2 = (2 * Math.atan(Math.exp(e1)) - Math.PI / 2) / (Math.PI / 180.0); + double flat = e2; + GeoPosition wc = new GeoPosition(flat, flon); + return wc; + } + + /** + * Gets the map bounds. + * @param mapViewer The map viewer. + * @return Returns the bounds. + */ + public static GeoBounds getMapBounds(JXMapViewer mapViewer) + { + return new GeoBounds(getMapGeoBounds(mapViewer)); + } + + /** + * Gets the bounds as a set of two GeoPosition objects. + * @param mapViewer The map viewer. + * @return Returns the set of two GeoPosition objects that represent the north west and south east + * corners of the map. + */ + private static Set getMapGeoBounds(JXMapViewer mapViewer) + { + Set set = new HashSet(); + TileFactory tileFactory = mapViewer.getTileFactory(); + int zoom = mapViewer.getZoom(); + Rectangle2D bounds = mapViewer.getViewportBounds(); + Point2D pt = new Point2D.Double(bounds.getX(), bounds.getY()); + set.add(tileFactory.pixelToGeo(pt, zoom)); + pt = new Point2D.Double(bounds.getX() + bounds.getWidth(), bounds.getY() + bounds.getHeight()); + set.add(tileFactory.pixelToGeo(pt, zoom)); + return set; + } + +} diff --git a/src/org/jdesktop/swingx/mapviewer/util/MercatorUtils.java b/src/main/java/org/jdesktop/swingx/mapviewer/util/MercatorUtils.java similarity index 100% rename from src/org/jdesktop/swingx/mapviewer/util/MercatorUtils.java rename to src/main/java/org/jdesktop/swingx/mapviewer/util/MercatorUtils.java diff --git a/src/org/jdesktop/swingx/mapviewer/wms/WMSService.java b/src/main/java/org/jdesktop/swingx/mapviewer/wms/WMSService.java similarity index 100% rename from src/org/jdesktop/swingx/mapviewer/wms/WMSService.java rename to src/main/java/org/jdesktop/swingx/mapviewer/wms/WMSService.java diff --git a/src/org/jdesktop/swingx/mapviewer/wms/WMSTileFactory.java b/src/main/java/org/jdesktop/swingx/mapviewer/wms/WMSTileFactory.java similarity index 100% rename from src/org/jdesktop/swingx/mapviewer/wms/WMSTileFactory.java rename to src/main/java/org/jdesktop/swingx/mapviewer/wms/WMSTileFactory.java diff --git a/src/org/jdesktop/swingx/painter/AbstractPainter.java b/src/main/java/org/jdesktop/swingx/painter/AbstractPainter.java similarity index 99% rename from src/org/jdesktop/swingx/painter/AbstractPainter.java rename to src/main/java/org/jdesktop/swingx/painter/AbstractPainter.java index 9ee25a72..bdc1a0ca 100644 --- a/src/org/jdesktop/swingx/painter/AbstractPainter.java +++ b/src/main/java/org/jdesktop/swingx/painter/AbstractPainter.java @@ -21,17 +21,14 @@ package org.jdesktop.swingx.painter; -import java.awt.AlphaComposite; -import java.awt.Composite; -import java.awt.Graphics2D; -import java.awt.RenderingHints; +import org.jdesktop.beans.AbstractBean; +import org.jdesktop.swingx.util.GraphicsUtilities; + +import java.awt.*; import java.awt.image.BufferedImage; import java.awt.image.BufferedImageOp; import java.lang.ref.SoftReference; -import org.jdesktop.beans.AbstractBean; -import org.jdesktop.swingx.util.GraphicsUtilities; - /** *

A convenient base class from which concrete {@link Painter} implementations may * extend. It extends {@link org.jdesktop.beans.AbstractBean} as a convenience for diff --git a/src/org/jdesktop/swingx/painter/CompoundPainter.java b/src/main/java/org/jdesktop/swingx/painter/CompoundPainter.java similarity index 96% rename from src/org/jdesktop/swingx/painter/CompoundPainter.java rename to src/main/java/org/jdesktop/swingx/painter/CompoundPainter.java index ed7c128b..90a8c3f8 100644 --- a/src/org/jdesktop/swingx/painter/CompoundPainter.java +++ b/src/main/java/org/jdesktop/swingx/painter/CompoundPainter.java @@ -1,497 +1,497 @@ -/* - * $Id: CompoundPainter.java 4147 2012-02-01 17:13:24Z kschaefe $ - * - * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle, - * Santa Clara, California 95054, U.S.A. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -package org.jdesktop.swingx.painter; - -import java.awt.Graphics2D; -import java.awt.geom.AffineTransform; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.lang.ref.WeakReference; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.concurrent.CopyOnWriteArrayList; - -//import org.jdesktop.beans.JavaBean; - -/** - *

A {@link Painter} implementation composed of an array of Painters. - * CompoundPainter provides a means for combining several individual - * Painters, or groups of them, into one logical unit. Each of the - * Painters are executed in order. BufferedImageOp filter effects can - * be applied to them together as a whole. The entire set of painting operations - * may be cached together.

- * - *

- * - *

For example, if I want to create a CompoundPainter that started with a blue - * background, had pinstripes on it running at a 45 degree angle, and those - * pinstripes appeared to "fade in" from left to right, I would write the following: - *


- *  Color blue = new Color(0x417DDD);
- *  Color translucent = new Color(blue.getRed(), blue.getGreen(), blue.getBlue(), 0);
- *  panel.setBackground(blue);
- *  panel.setForeground(Color.LIGHT_GRAY);
- *  GradientPaint blueToTranslucent = new GradientPaint(
- *    new Point2D.Double(.4, 0),
- *    blue,
- *    new Point2D.Double(1, 0),
- *    translucent);
- *  MattePainter veil = new MattePainter(blueToTranslucent);
- *  veil.setPaintStretched(true);
- *  Painter pinstripes = new PinstripePainter(45);
- *  Painter backgroundPainter = new RectanglePainter(this.getBackground(), null);
- *  Painter p = new CompoundPainter(backgroundPainter, pinstripes, veil);
- *  panel.setBackgroundPainter(p);
- * 

- * - * @author rbair - * @param an optional configuration parameter - */ -//@JavaBean -public class CompoundPainter extends AbstractPainter -{ - private static class Handler implements PropertyChangeListener - { - private final WeakReference> ref; - - public Handler(CompoundPainter painter) - { - ref = new WeakReference>(painter); - } - - /** - * {@inheritDoc} - */ - @Override - public void propertyChange(PropertyChangeEvent evt) - { - CompoundPainter painter = ref.get(); - - if (painter == null) - { - AbstractPainter src = (AbstractPainter) evt.getSource(); - src.removePropertyChangeListener(this); - } - else - { - String property = evt.getPropertyName(); - - if ("dirty".equals(property) && evt.getNewValue() == Boolean.FALSE) - { - return; - } - - painter.setDirty(true); - } - } - } - - private Handler handler; - - private List> painters = new CopyOnWriteArrayList>(); - private AffineTransform transform; - private boolean clipPreserved = false; - - private boolean checkForDirtyChildPainters = true; - - /** Creates a new instance of CompoundPainter */ - public CompoundPainter() - { - this((Painter[]) null); - } - - /** - * Convenience constructor for creating a CompoundPainter for an array - * of painters. A defensive copy of the given array is made, so that future - * modification to the array does not result in changes to the CompoundPainter. - * - * @param painters array of painters, which will be painted in order - */ - public CompoundPainter(Painter... painters) - { - handler = new Handler(this); - - setPainters(painters); - } - - /** - * Convenience constructor for creating a CompoundPainter for a list - * of painters. A defensive copy of the given array is made, so that future - * modification to the list does not result in changes to the CompoundPainter. - * - * @param painters array of painters, which will be painted in order - */ - public CompoundPainter(List> painters) - { - handler = new Handler(this); - - setPainters(painters); - } - /** - * Sets the array of Painters to use. These painters will be executed in - * order. A null value will be treated as an empty array. To prevent unexpected - * behavior all values in provided array are copied to internally held array. - * Any changes to the original array will not be reflected. - * - * @param painters array of painters, which will be painted in order - */ - public void setPainters(List> painters) - { - Collection> old = new ArrayList>(getPainters()); - - for (Painter p : old) - { - if (p instanceof AbstractPainter) - { - ((AbstractPainter) p).removePropertyChangeListener(handler); - } - } - - this.painters.clear(); - this.painters.addAll(painters); - - for (Painter p : this.painters) - { - if (p instanceof AbstractPainter) - { - ((AbstractPainter) p).addPropertyChangeListener(handler); - } - } - - setDirty(true); - firePropertyChange("painters", old, getPainters()); - } - - /** - * Sets the array of Painters to use. These painters will be executed in - * order. A null value will be treated as an empty array. To prevent unexpected - * behavior all values in provided array are copied to internally held array. - * Any changes to the original array will not be reflected. - * - * @param painters array of painters, which will be painted in order - */ - public void setPainters(Painter... painters) - { - List> l; - - if (painters == null) - l = Collections.emptyList(); - else - l = Arrays.asList(painters); - - setPainters(l); - } - - /** - * Adds a painter to the queue of painters - * @param painter the painter that is added - */ - public void addPainter(Painter painter) - { - Collection> old = new ArrayList>(getPainters()); - - this.painters.add(painter); - - if (painter instanceof AbstractPainter) - { - ((AbstractPainter) painter).addPropertyChangeListener(handler); - } - - setDirty(true); - firePropertyChange("painters", old, getPainters()); - } - - /** - * Removes a painter from the queue of painters - * @param painter the painter that is added - */ - public void removePainter(Painter painter) - { - Collection> old = new ArrayList>(getPainters()); - - this.painters.remove(painter); - - if (painter instanceof AbstractPainter) - { - ((AbstractPainter) painter).removePropertyChangeListener(handler); - } - - setDirty(true); - firePropertyChange("painters", old, getPainters()); - } - - - /** - * Gets the array of painters used by this CompoundPainter - * @return a defensive copy of the painters used by this CompoundPainter. - * This will never be null. - */ - public final Collection> getPainters() - { - return Collections.unmodifiableCollection(painters); - } - - /** - * Indicates if the clip produced by any painter is left set once it finishes painting. - * Normally the clip will be reset between each painter. Setting clipPreserved to - * true can be used to let one painter mask other painters that come after it. - * @return if the clip should be preserved - * @see #setClipPreserved(boolean) - */ - public boolean isClipPreserved() - { - return clipPreserved; - } - - /** - * Sets if the clip should be preserved. - * Normally the clip will be reset between each painter. Setting clipPreserved to - * true can be used to let one painter mask other painters that come after it. - * - * @param shouldRestoreState new value of the clipPreserved property - * @see #isClipPreserved() - */ - public void setClipPreserved(boolean shouldRestoreState) - { - boolean oldShouldRestoreState = isClipPreserved(); - this.clipPreserved = shouldRestoreState; - setDirty(true); - firePropertyChange("clipPreserved", oldShouldRestoreState, shouldRestoreState); - } - - /** - * Gets the current transform applied to all painters in this CompoundPainter. May be null. - * @return the current AffineTransform - */ - public AffineTransform getTransform() - { - return transform; - } - - /** - * Set a transform to be applied to all painters contained in this CompoundPainter - * @param transform a new AffineTransform - */ - public void setTransform(AffineTransform transform) - { - AffineTransform old = getTransform(); - this.transform = transform; - setDirty(true); - firePropertyChange("transform", old, transform); - } - - /** - *

Iterates over all child Painters and gives them a chance - * to validate themselves. If any of the child painters are dirty, then - * this CompoundPainter marks itself as dirty.

- */ - @Override - protected void validate(T object) - { - boolean dirty = false; - for (Painter p : painters) - { - if (p instanceof AbstractPainter) - { - AbstractPainter ap = (AbstractPainter) p; - ap.validate(object); - if (ap.isDirty()) - { - dirty = true; - break; - } - } - } - clearLocalCacheOnly = true; - setDirty(dirty); //super will call clear cache - clearLocalCacheOnly = false; - } - - //indicates whether the local cache should be cleared only, as opposed to the - //cache's of all of the children. This is needed to optimize the caching strategy - //when, during validate, the CompoundPainter is marked as dirty - private boolean clearLocalCacheOnly = false; - - /** - * Used by {@link #isDirty()} to check if the child Painters - * should be checked for their dirty flag as part of - * processing.
- * Default value is: true
- * This should be set to false if the cacheable state - * of the child Painters are different from each other. This - * will allow the cacheable == true Painters to - * keep their cached image during regular repaints. In this case, - * client code should call {@link #clearCache()} manually when the cacheable - * Painters should be updated. - * @return the dirty check flag - * - * - * @see #isDirty() - */ - public boolean isCheckingDirtyChildPainters() - { - return checkForDirtyChildPainters; - } - - /** - * Set the flag used by {@link #isDirty()} to check if the - * child Painters should be checked for their - * dirty flag as part of processing. - * @param b the dirty check flag - * - * @see #isCheckingDirtyChildPainters() - * @see #isDirty() - */ - public void setCheckingDirtyChildPainters(boolean b) - { - boolean old = isCheckingDirtyChildPainters(); - this.checkForDirtyChildPainters = b; - firePropertyChange("checkingDirtyChildPainters", old, isCheckingDirtyChildPainters()); - } - - /** - *

This CompoundPainter is dirty if it, or (optionally) - * any of its children, are dirty. If the super implementation returns - * true, we return true. Otherwise, if - * {@link #isCheckingDirtyChildPainters()} is true, we iterate - * over all child Painters and query them to see - * if they are dirty. If so, then true is returned. - * Otherwise, we return false.

- * - * @see #isCheckingDirtyChildPainters() - */ - @Override - protected boolean isDirty() - { - boolean dirty = super.isDirty(); - if (dirty) - { - return true; - } - else if (isCheckingDirtyChildPainters()) - { - for (Painter p : painters) - { - if (p instanceof AbstractPainter) - { - AbstractPainter ap = (AbstractPainter) p; - if (ap.isDirty()) - { - return true; - } - } - } - } - return false; - } - - @Override - protected void setDirty(boolean d) - { - boolean old = super.isDirty(); - boolean ours = isDirty(); - - super.setDirty(d); - - //must perform this check to ensure we do not double notify - if (d != old && d == ours) - { - firePropertyChange("dirty", old, isDirty()); - } - } - - /** - *

Clears the cache of this Painter, and all child - * Painters. This is done to ensure that resources - * are collected, even if clearCache is called by some framework - * or other code that doesn't realize this is a CompoundPainter.

- * - *

Call #clearLocalCache if you only want to clear the cache of this - * CompoundPainter - */ - @Override - public void clearCache() - { - if (!clearLocalCacheOnly) - { - for (Painter p : painters) - { - if (p instanceof AbstractPainter) - { - AbstractPainter ap = (AbstractPainter) p; - ap.clearCache(); - } - } - } - super.clearCache(); - } - - /** - *

Clears the cache of this painter only, and not of any of the children.

- */ - public void clearLocalCache() - { - super.clearCache(); - } - - @Override - protected void doPaint(Graphics2D g, T component, int width, int height) - { - for (Painter p : getPainters()) - { - Graphics2D temp = (Graphics2D) g.create(); - - try - { - p.paint(temp, component, width, height); - if (isClipPreserved()) - { - g.setClip(temp.getClip()); - } - } - finally - { - temp.dispose(); - } - } - } - - @Override - protected void configureGraphics(Graphics2D g) - { - //applies the transform - AffineTransform tx = getTransform(); - if (tx != null) - { - g.setTransform(tx); - } - } - - @Override - protected boolean shouldUseCache() - { - return super.shouldUseCache(); // || (painters != null && painters.length > 1); - } -} +/* + * $Id: CompoundPainter.java 4147 2012-02-01 17:13:24Z kschaefe $ + * + * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle, + * Santa Clara, California 95054, U.S.A. All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package org.jdesktop.swingx.painter; + +import java.awt.*; +import java.awt.geom.AffineTransform; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.lang.ref.WeakReference; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; + +//import org.jdesktop.beans.JavaBean; + +/** + *

A {@link Painter} implementation composed of an array of Painters. + * CompoundPainter provides a means for combining several individual + * Painters, or groups of them, into one logical unit. Each of the + * Painters are executed in order. BufferedImageOp filter effects can + * be applied to them together as a whole. The entire set of painting operations + * may be cached together.

+ * + *

+ * + *

For example, if I want to create a CompoundPainter that started with a blue + * background, had pinstripes on it running at a 45 degree angle, and those + * pinstripes appeared to "fade in" from left to right, I would write the following: + *


+ *  Color blue = new Color(0x417DDD);
+ *  Color translucent = new Color(blue.getRed(), blue.getGreen(), blue.getBlue(), 0);
+ *  panel.setBackground(blue);
+ *  panel.setForeground(Color.LIGHT_GRAY);
+ *  GradientPaint blueToTranslucent = new GradientPaint(
+ *    new Point2D.Double(.4, 0),
+ *    blue,
+ *    new Point2D.Double(1, 0),
+ *    translucent);
+ *  MattePainter veil = new MattePainter(blueToTranslucent);
+ *  veil.setPaintStretched(true);
+ *  Painter pinstripes = new PinstripePainter(45);
+ *  Painter backgroundPainter = new RectanglePainter(this.getBackground(), null);
+ *  Painter p = new CompoundPainter(backgroundPainter, pinstripes, veil);
+ *  panel.setBackgroundPainter(p);
+ * 

+ * + * @author rbair + * @param an optional configuration parameter + */ +//@JavaBean +public class CompoundPainter extends AbstractPainter +{ + private static class Handler implements PropertyChangeListener + { + private final WeakReference> ref; + + public Handler(CompoundPainter painter) + { + ref = new WeakReference>(painter); + } + + /** + * {@inheritDoc} + */ + @Override + public void propertyChange(PropertyChangeEvent evt) + { + CompoundPainter painter = ref.get(); + + if (painter == null) + { + AbstractPainter src = (AbstractPainter) evt.getSource(); + src.removePropertyChangeListener(this); + } + else + { + String property = evt.getPropertyName(); + + if ("dirty".equals(property) && evt.getNewValue() == Boolean.FALSE) + { + return; + } + + painter.setDirty(true); + } + } + } + + private Handler handler; + + private List> painters = new CopyOnWriteArrayList>(); + private AffineTransform transform; + private boolean clipPreserved = false; + + private boolean checkForDirtyChildPainters = true; + + /** Creates a new instance of CompoundPainter */ + public CompoundPainter() + { + this((Painter[]) null); + } + + /** + * Convenience constructor for creating a CompoundPainter for an array + * of painters. A defensive copy of the given array is made, so that future + * modification to the array does not result in changes to the CompoundPainter. + * + * @param painters array of painters, which will be painted in order + */ + public CompoundPainter(Painter... painters) + { + handler = new Handler(this); + + setPainters(painters); + } + + /** + * Convenience constructor for creating a CompoundPainter for a list + * of painters. A defensive copy of the given array is made, so that future + * modification to the list does not result in changes to the CompoundPainter. + * + * @param painters array of painters, which will be painted in order + */ + public CompoundPainter(List> painters) + { + handler = new Handler(this); + + setPainters(painters); + } + /** + * Sets the array of Painters to use. These painters will be executed in + * order. A null value will be treated as an empty array. To prevent unexpected + * behavior all values in provided array are copied to internally held array. + * Any changes to the original array will not be reflected. + * + * @param painters array of painters, which will be painted in order + */ + public void setPainters(List> painters) + { + Collection> old = new ArrayList>(getPainters()); + + for (Painter p : old) + { + if (p instanceof AbstractPainter) + { + ((AbstractPainter) p).removePropertyChangeListener(handler); + } + } + + this.painters.clear(); + this.painters.addAll(painters); + + for (Painter p : this.painters) + { + if (p instanceof AbstractPainter) + { + ((AbstractPainter) p).addPropertyChangeListener(handler); + } + } + + setDirty(true); + firePropertyChange("painters", old, getPainters()); + } + + /** + * Sets the array of Painters to use. These painters will be executed in + * order. A null value will be treated as an empty array. To prevent unexpected + * behavior all values in provided array are copied to internally held array. + * Any changes to the original array will not be reflected. + * + * @param painters array of painters, which will be painted in order + */ + public void setPainters(Painter... painters) + { + List> l; + + if (painters == null) + l = Collections.emptyList(); + else + l = Arrays.asList(painters); + + setPainters(l); + } + + /** + * Adds a painter to the queue of painters + * @param painter the painter that is added + */ + public void addPainter(Painter painter) + { + Collection> old = new ArrayList>(getPainters()); + + this.painters.add(painter); + + if (painter instanceof AbstractPainter) + { + ((AbstractPainter) painter).addPropertyChangeListener(handler); + } + + setDirty(true); + firePropertyChange("painters", old, getPainters()); + } + + /** + * Removes a painter from the queue of painters + * @param painter the painter that is added + */ + public void removePainter(Painter painter) + { + Collection> old = new ArrayList>(getPainters()); + + this.painters.remove(painter); + + if (painter instanceof AbstractPainter) + { + ((AbstractPainter) painter).removePropertyChangeListener(handler); + } + + setDirty(true); + firePropertyChange("painters", old, getPainters()); + } + + + /** + * Gets the array of painters used by this CompoundPainter + * @return a defensive copy of the painters used by this CompoundPainter. + * This will never be null. + */ + public final Collection> getPainters() + { + return Collections.unmodifiableCollection(painters); + } + + /** + * Indicates if the clip produced by any painter is left set once it finishes painting. + * Normally the clip will be reset between each painter. Setting clipPreserved to + * true can be used to let one painter mask other painters that come after it. + * @return if the clip should be preserved + * @see #setClipPreserved(boolean) + */ + public boolean isClipPreserved() + { + return clipPreserved; + } + + /** + * Sets if the clip should be preserved. + * Normally the clip will be reset between each painter. Setting clipPreserved to + * true can be used to let one painter mask other painters that come after it. + * + * @param shouldRestoreState new value of the clipPreserved property + * @see #isClipPreserved() + */ + public void setClipPreserved(boolean shouldRestoreState) + { + boolean oldShouldRestoreState = isClipPreserved(); + this.clipPreserved = shouldRestoreState; + setDirty(true); + firePropertyChange("clipPreserved", oldShouldRestoreState, shouldRestoreState); + } + + /** + * Gets the current transform applied to all painters in this CompoundPainter. May be null. + * @return the current AffineTransform + */ + public AffineTransform getTransform() + { + return transform; + } + + /** + * Set a transform to be applied to all painters contained in this CompoundPainter + * @param transform a new AffineTransform + */ + public void setTransform(AffineTransform transform) + { + AffineTransform old = getTransform(); + this.transform = transform; + setDirty(true); + firePropertyChange("transform", old, transform); + } + + /** + *

Iterates over all child Painters and gives them a chance + * to validate themselves. If any of the child painters are dirty, then + * this CompoundPainter marks itself as dirty.

+ */ + @Override + protected void validate(T object) + { + boolean dirty = false; + for (Painter p : painters) + { + if (p instanceof AbstractPainter) + { + AbstractPainter ap = (AbstractPainter) p; + ap.validate(object); + if (ap.isDirty()) + { + dirty = true; + break; + } + } + } + clearLocalCacheOnly = true; + setDirty(dirty); //super will call clear cache + clearLocalCacheOnly = false; + } + + //indicates whether the local cache should be cleared only, as opposed to the + //cache's of all of the children. This is needed to optimize the caching strategy + //when, during validate, the CompoundPainter is marked as dirty + private boolean clearLocalCacheOnly = false; + + /** + * Used by {@link #isDirty()} to check if the child Painters + * should be checked for their dirty flag as part of + * processing.
+ * Default value is: true
+ * This should be set to false if the cacheable state + * of the child Painters are different from each other. This + * will allow the cacheable == true Painters to + * keep their cached image during regular repaints. In this case, + * client code should call {@link #clearCache()} manually when the cacheable + * Painters should be updated. + * @return the dirty check flag + * + * + * @see #isDirty() + */ + public boolean isCheckingDirtyChildPainters() + { + return checkForDirtyChildPainters; + } + + /** + * Set the flag used by {@link #isDirty()} to check if the + * child Painters should be checked for their + * dirty flag as part of processing. + * @param b the dirty check flag + * + * @see #isCheckingDirtyChildPainters() + * @see #isDirty() + */ + public void setCheckingDirtyChildPainters(boolean b) + { + boolean old = isCheckingDirtyChildPainters(); + this.checkForDirtyChildPainters = b; + firePropertyChange("checkingDirtyChildPainters", old, isCheckingDirtyChildPainters()); + } + + /** + *

This CompoundPainter is dirty if it, or (optionally) + * any of its children, are dirty. If the super implementation returns + * true, we return true. Otherwise, if + * {@link #isCheckingDirtyChildPainters()} is true, we iterate + * over all child Painters and query them to see + * if they are dirty. If so, then true is returned. + * Otherwise, we return false.

+ * + * @see #isCheckingDirtyChildPainters() + */ + @Override + protected boolean isDirty() + { + boolean dirty = super.isDirty(); + if (dirty) + { + return true; + } + else if (isCheckingDirtyChildPainters()) + { + for (Painter p : painters) + { + if (p instanceof AbstractPainter) + { + AbstractPainter ap = (AbstractPainter) p; + if (ap.isDirty()) + { + return true; + } + } + } + } + return false; + } + + @Override + protected void setDirty(boolean d) + { + boolean old = super.isDirty(); + boolean ours = isDirty(); + + super.setDirty(d); + + //must perform this check to ensure we do not double notify + if (d != old && d == ours) + { + firePropertyChange("dirty", old, isDirty()); + } + } + + /** + *

Clears the cache of this Painter, and all child + * Painters. This is done to ensure that resources + * are collected, even if clearCache is called by some framework + * or other code that doesn't realize this is a CompoundPainter.

+ * + *

Call #clearLocalCache if you only want to clear the cache of this + * CompoundPainter + */ + @Override + public void clearCache() + { + if (!clearLocalCacheOnly) + { + for (Painter p : painters) + { + if (p instanceof AbstractPainter) + { + AbstractPainter ap = (AbstractPainter) p; + ap.clearCache(); + } + } + } + super.clearCache(); + } + + /** + *

Clears the cache of this painter only, and not of any of the children.

+ */ + public void clearLocalCache() + { + super.clearCache(); + } + + @Override + protected void doPaint(Graphics2D g, T component, int width, int height) + { + for (Painter p : getPainters()) + { + Graphics2D temp = (Graphics2D) g.create(); + + try + { + p.paint(temp, component, width, height); + if (isClipPreserved()) + { + g.setClip(temp.getClip()); + } + } + finally + { + temp.dispose(); + } + } + } + + @Override + protected void configureGraphics(Graphics2D g) + { + //applies the transform + AffineTransform tx = getTransform(); + if (tx != null) + { + g.setTransform(tx); + } + } + + @Override + protected boolean shouldUseCache() + { + return super.shouldUseCache(); // || (painters != null && painters.length > 1); + } +} diff --git a/src/org/jdesktop/swingx/painter/Painter.java b/src/main/java/org/jdesktop/swingx/painter/Painter.java similarity index 99% rename from src/org/jdesktop/swingx/painter/Painter.java rename to src/main/java/org/jdesktop/swingx/painter/Painter.java index 1c9f69bd..67ddb7f5 100644 --- a/src/org/jdesktop/swingx/painter/Painter.java +++ b/src/main/java/org/jdesktop/swingx/painter/Painter.java @@ -21,7 +21,7 @@ package org.jdesktop.swingx.painter; -import java.awt.Graphics2D; +import java.awt.*; /** *

A painting delegate. The Painter interface defines exactly one method, diff --git a/src/org/jdesktop/swingx/util/GraphicsUtilities.java b/src/main/java/org/jdesktop/swingx/util/GraphicsUtilities.java similarity index 99% rename from src/org/jdesktop/swingx/util/GraphicsUtilities.java rename to src/main/java/org/jdesktop/swingx/util/GraphicsUtilities.java index 64a91062..11de119d 100644 --- a/src/org/jdesktop/swingx/util/GraphicsUtilities.java +++ b/src/main/java/org/jdesktop/swingx/util/GraphicsUtilities.java @@ -34,17 +34,9 @@ package org.jdesktop.swingx.util; -import java.awt.AlphaComposite; -import java.awt.Color; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.GraphicsConfiguration; -import java.awt.GraphicsEnvironment; -import java.awt.Image; -import java.awt.Insets; -import java.awt.RenderingHints; -import java.awt.Shape; -import java.awt.Transparency; +import javax.imageio.ImageIO; +import javax.swing.*; +import java.awt.*; import java.awt.image.BufferedImage; import java.awt.image.ColorModel; import java.awt.image.Raster; @@ -53,9 +45,6 @@ import java.io.IOException; import java.io.InputStream; import java.net.URL; -import javax.imageio.ImageIO; -import javax.swing.JComponent; - /** *

GraphicsUtilities contains a set of tools to perform * common graphics operations easily. These operations are divided into diff --git a/src/org/jdesktop/swingx/util/ShapeUtils.java b/src/main/java/org/jdesktop/swingx/util/ShapeUtils.java similarity index 97% rename from src/org/jdesktop/swingx/util/ShapeUtils.java rename to src/main/java/org/jdesktop/swingx/util/ShapeUtils.java index 45a79ab1..96b7b149 100644 --- a/src/org/jdesktop/swingx/util/ShapeUtils.java +++ b/src/main/java/org/jdesktop/swingx/util/ShapeUtils.java @@ -20,11 +20,7 @@ */ package org.jdesktop.swingx.util; -import java.awt.Font; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Polygon; -import java.awt.Shape; +import java.awt.*; import java.awt.font.GlyphVector; import java.awt.geom.AffineTransform; import java.awt.geom.Area; diff --git a/src/org/jma/encoder/audio/IAudioEncoder.java b/src/main/java/org/jma/encoder/audio/IAudioEncoder.java similarity index 100% rename from src/org/jma/encoder/audio/IAudioEncoder.java rename to src/main/java/org/jma/encoder/audio/IAudioEncoder.java diff --git a/config/52-airspy.rules b/src/main/resources/52-airspy.rules similarity index 100% rename from config/52-airspy.rules rename to src/main/resources/52-airspy.rules diff --git a/config/53-hackrf.rules b/src/main/resources/53-hackrf.rules similarity index 100% rename from config/53-hackrf.rules rename to src/main/resources/53-hackrf.rules diff --git a/bin/dsp/filter/design/FilterView.css b/src/main/resources/FilterView.css similarity index 79% rename from bin/dsp/filter/design/FilterView.css rename to src/main/resources/FilterView.css index 9c70eec8..eed6bc12 100644 --- a/bin/dsp/filter/design/FilterView.css +++ b/src/main/resources/FilterView.css @@ -1,12 +1,12 @@ /* ....Show License.... */ .chart { - -fx-background-image: url("../../../../images/Curve-fitted-background.png"); + -fx-background-image: url("../../../images/Curve-fitted-background.png"); -fx-padding: 15 25 15 15; } .chart-plot-background { -fx-background-color: red; - -fx-background-image: url("../../../../images/Curve-fitted-chart-background.png"), - url("../../../../images/Curve-fitted-graph-gridlines.png"); + -fx-background-image: url("../../../images/Curve-fitted-chart-background.png"), + url("../../../images/Curve-fitted-graph-gridlines.png"); -fx-background-size: cover, auto; -fx-background-repeat: no-repeat, repeat; -fx-background-position: 0% 0%, 0% 100%; diff --git a/config/funcube-dongle.rules b/src/main/resources/funcube-dongle.rules similarity index 100% rename from config/funcube-dongle.rules rename to src/main/resources/funcube-dongle.rules diff --git a/config/javax.usb.properties b/src/main/resources/javax.usb.properties similarity index 100% rename from config/javax.usb.properties rename to src/main/resources/javax.usb.properties diff --git a/config/logback.xml b/src/main/resources/logback.xml similarity index 55% rename from config/logback.xml rename to src/main/resources/logback.xml index 6672ec07..34f5140f 100644 --- a/config/logback.xml +++ b/src/main/resources/logback.xml @@ -1,5 +1,23 @@ + - + diff --git a/config/rtl-sdr.rules b/src/main/resources/rtl-sdr.rules similarity index 100% rename from config/rtl-sdr.rules rename to src/main/resources/rtl-sdr.rules diff --git a/src/map/DefaultIcon.java b/src/map/DefaultIcon.java deleted file mode 100644 index 0be8dd87..00000000 --- a/src/map/DefaultIcon.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package map; - -import settings.Setting; - -public class DefaultIcon extends Setting -{ - public DefaultIcon( String name ) - { - super( name ); - } - - /** - * Don't use this constructor. This is used by JAXB to unmarshall saved - * map icons. - */ - public DefaultIcon() - { - } -} diff --git a/src/map/MapIcon.java b/src/map/MapIcon.java deleted file mode 100644 index ffe3bf0e..00000000 --- a/src/map/MapIcon.java +++ /dev/null @@ -1,188 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package map; - -import java.awt.Image; - -import javax.swing.ImageIcon; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlTransient; - -import settings.Setting; - -public class MapIcon extends Setting implements Comparable -{ - 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 ); - } - - /** - * Don't use this constructor. This is used by JAXB to unmarshall saved - * map icons. - */ - public MapIcon() - { - mEditable = true; - } - - - @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 ) - { - return getName().compareTo( other.getName() ); - } -} diff --git a/src/module/decode/config/DecodeConfiguration.java b/src/module/decode/config/DecodeConfiguration.java deleted file mode 100644 index 8390d608..00000000 --- a/src/module/decode/config/DecodeConfiguration.java +++ /dev/null @@ -1,104 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package module.decode.config; - -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; - -import module.decode.DecoderType; -import module.decode.am.DecodeConfigAM; -import module.decode.ltrnet.DecodeConfigLTRNet; -import module.decode.ltrstandard.DecodeConfigLTRStandard; -import module.decode.mpt1327.DecodeConfigMPT1327; -import module.decode.nbfm.DecodeConfigNBFM; -import module.decode.p25.DecodeConfigP25Phase1; -import module.decode.passport.DecodeConfigPassport; -import controller.config.Configuration; - -@XmlSeeAlso( { DecodeConfigAM.class, - DecodeConfigNBFM.class, - DecodeConfigLTRNet.class, - DecodeConfigLTRStandard.class, - DecodeConfigMPT1327.class, - DecodeConfigPassport.class, - DecodeConfigP25Phase1.class } ) -@XmlRootElement( name = "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_AFC_MAX_CORRECTION = 1000; - - private DecoderType mDecoderType = DecoderType.NBFM; - private boolean mAFCEnabled = true; - private int mAFCMaxCorrection = DEFAULT_AFC_MAX_CORRECTION; - - public DecodeConfiguration() - { - this( DecoderType.NBFM ); - } - - public DecodeConfiguration( DecoderType type ) - { - mDecoderType = type; - } - - public DecoderType getDecoderType() - { - return mDecoderType; - } - - @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; - } -} diff --git a/src/module/decode/mpt1327/DecodeConfigMPT1327.java b/src/module/decode/mpt1327/DecodeConfigMPT1327.java deleted file mode 100644 index 926272a3..00000000 --- a/src/module/decode/mpt1327/DecodeConfigMPT1327.java +++ /dev/null @@ -1,102 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package module.decode.mpt1327; - -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -import module.decode.DecoderType; -import module.decode.config.DecodeConfiguration; -import module.decode.mpt1327.MPT1327Decoder.Sync; - -public class DecodeConfigMPT1327 extends DecodeConfiguration -{ - private String mChannelMapName; - private Sync mSync = Sync.NORMAL; - - private int mCallTimeout = DEFAULT_CALL_TIMEOUT_SECONDS; - private int mTrafficChannelPoolSize = TRAFFIC_CHANNEL_LIMIT_DEFAULT; - - public DecodeConfigMPT1327() - { - super( DecoderType.MPT1327 ); - } - - @XmlElement - public String getChannelMapName() - { - return mChannelMapName; - } - - public void setChannelMapName( String name ) - { - mChannelMapName = name; - } - - @XmlAttribute( name="sync" ) - public Sync getSync() - { - return mSync; - } - - public void setSync( Sync sync ) - { - mSync = sync; - } - - @XmlAttribute( name="call_timeout" ) - public int getCallTimeout() - { - return mCallTimeout; - } - - /** - * Sets the call timeout value in seconds ( 10 - 600 ); - * @param timeout - */ - public void setCallTimeout( int timeout ) - { - if( CALL_TIMEOUT_MINIMUM <= timeout && timeout <= CALL_TIMEOUT_MAXIMUM ) - { - mCallTimeout = timeout; - } - else - { - mCallTimeout = DEFAULT_CALL_TIMEOUT_SECONDS; - } - } - - @XmlAttribute( name="traffic_channel_pool_size" ) - public int getTrafficChannelPoolSize() - { - return mTrafficChannelPoolSize; - } - - /** - * Sets the traffic channel pool size which is the maximum number of - * simultaneous traffic channels that can be allocated. - * - * This limits the maximum calls so that busy systems won't cause more - * traffic channels to be allocated than the decoder/software/host computer - * can support. - */ - public void setTrafficChannelPoolSize( int size ) - { - mTrafficChannelPoolSize = size; - } -} diff --git a/src/module/decode/p25/DecodeConfigP25Phase1.java b/src/module/decode/p25/DecodeConfigP25Phase1.java deleted file mode 100644 index 25b3ddac..00000000 --- a/src/module/decode/p25/DecodeConfigP25Phase1.java +++ /dev/null @@ -1,108 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package module.decode.p25; - -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlTransient; - -import module.decode.DecoderType; -import module.decode.config.DecodeConfiguration; -import module.decode.p25.P25Decoder.Modulation; - -public class DecodeConfigP25Phase1 extends DecodeConfiguration -{ - private P25_LSMDecoder.Modulation mModulation = Modulation.C4FM; - - private int mCallTimeout = 1; - private int mTrafficChannelPoolSize = TRAFFIC_CHANNEL_LIMIT_DEFAULT; - private boolean mIgnoreDataCalls = true; - - public DecodeConfigP25Phase1() - { - super( DecoderType.P25_PHASE1 ); - - setAFC( false ); - } - - public boolean supportsAFC() - { - return false; - } - - @XmlAttribute( name = "modulation" ) - public P25_LSMDecoder.Modulation getModulation() - { - return mModulation; - } - - public void setModulation( P25_LSMDecoder.Modulation modulation ) - { - mModulation = modulation; - } - - @XmlAttribute( name = "ignore_data_calls" ) - public boolean getIgnoreDataCalls() - { - return mIgnoreDataCalls; - } - - public void setIgnoreDataCalls( boolean ignore ) - { - mIgnoreDataCalls = ignore; - } - - /** - * Note: this field is now deprecated. - * @return - */ - @XmlTransient - @Deprecated - public int getCallTimeout() - { - return mCallTimeout; - } - - /** - * Sets the call timeout value in seconds ( 10 - 600 ); - * @param timeout - */ - @Deprecated - public void setCallTimeout( int timeout ) - { - } - - - @XmlAttribute( name="traffic_channel_pool_size" ) - public int getTrafficChannelPoolSize() - { - return mTrafficChannelPoolSize; - } - - /** - * Sets the traffic channel pool size which is the maximum number of - * simultaneous traffic channels that can be allocated. - * - * This limits the maximum calls so that busy systems won't cause more - * traffic channels to be allocated than the decoder/software/host computer - * can support. - */ - public void setTrafficChannelPoolSize( int size ) - { - mTrafficChannelPoolSize = size; - } -} diff --git a/src/module/decode/p25/message/pdu/PDUMessageFactory.java b/src/module/decode/p25/message/pdu/PDUMessageFactory.java deleted file mode 100644 index 26b25b1c..00000000 --- a/src/module/decode/p25/message/pdu/PDUMessageFactory.java +++ /dev/null @@ -1,131 +0,0 @@ -package module.decode.p25.message.pdu; - -import module.decode.p25.message.pdu.osp.control.AdjacentStatusBroadcastExtended; -import module.decode.p25.message.pdu.osp.control.CallAlertExtended; -import module.decode.p25.message.pdu.osp.control.GroupAffiliationQueryExtended; -import module.decode.p25.message.pdu.osp.control.GroupAffiliationResponseExtended; -import module.decode.p25.message.pdu.osp.control.MessageUpdateExtended; -import module.decode.p25.message.pdu.osp.control.NetworkStatusBroadcastExtended; -import module.decode.p25.message.pdu.osp.control.ProtectionParameterBroadcast; -import module.decode.p25.message.pdu.osp.control.RFSSStatusBroadcastExtended; -import module.decode.p25.message.pdu.osp.control.RoamingAddressUpdateExtended; -import module.decode.p25.message.pdu.osp.control.StatusQueryExtended; -import module.decode.p25.message.pdu.osp.control.StatusUpdateExtended; -import module.decode.p25.message.pdu.osp.control.UnitRegistrationResponseExtended; -import module.decode.p25.message.pdu.osp.data.GroupDataChannelGrantExtended; -import module.decode.p25.message.pdu.osp.data.IndividualDataChannelGrantExtended; -import module.decode.p25.message.pdu.osp.voice.GroupVoiceChannelGrantExplicit; -import module.decode.p25.message.pdu.osp.voice.TelephoneInterconnectChannelGrantExplicit; -import module.decode.p25.message.pdu.osp.voice.TelephoneInterconnectChannelGrantUpdateExplicit; -import module.decode.p25.message.pdu.osp.voice.UnitToUnitAnswerRequestExplicit; -import module.decode.p25.message.pdu.osp.voice.UnitToUnitVoiceChannelGrantExtended; -import module.decode.p25.message.pdu.osp.voice.UnitToUnitVoiceChannelGrantUpdateExtended; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import module.decode.p25.reference.PDUFormat; -import module.decode.p25.reference.Vendor; -import alias.AliasList; -import bits.BinaryMessage; - -public class PDUMessageFactory -{ - public static PDUMessage getMessage( BinaryMessage message, - DataUnitID duid, - AliasList aliasList ) - { - PDUFormat format = PDUFormat.fromValue( - message.getInt( PDUMessage.FORMAT ) ); - - switch( format ) - { - case ALTERNATE_MULTI_BLOCK_TRUNKING_CONTROL: - Vendor vendor = Vendor.fromValue( - message.getInt( PDUMessage.VENDOR_ID ) ); - - switch( vendor ) - { - case STANDARD: - Opcode opcode = Opcode.fromValue( - message.getInt( PDUMessage.OPCODE ) ); - - switch( opcode ) - { - case ADJACENT_STATUS_BROADCAST: - return new AdjacentStatusBroadcastExtended( - message, duid, aliasList ); - case CALL_ALERT: - return new CallAlertExtended( message, duid, - aliasList ); - case GROUP_AFFILIATION_QUERY: - return new GroupAffiliationQueryExtended( - message, duid, aliasList ); - case GROUP_AFFILIATION_RESPONSE: - return new GroupAffiliationResponseExtended( - message, duid, aliasList ); - case GROUP_DATA_CHANNEL_GRANT: - return new GroupDataChannelGrantExtended( - message, duid, aliasList ); - case GROUP_VOICE_CHANNEL_GRANT: - - return new GroupVoiceChannelGrantExplicit( - message, duid, aliasList ); - case INDIVIDUAL_DATA_CHANNEL_GRANT: - return new IndividualDataChannelGrantExtended( - message, duid, aliasList ); - case MESSAGE_UPDATE: - return new MessageUpdateExtended( message, duid, - aliasList ); - case NETWORK_STATUS_BROADCAST: - return new NetworkStatusBroadcastExtended( - message, duid, aliasList ); - case PROTECTION_PARAMETER_BROADCAST: - return new ProtectionParameterBroadcast( - message, duid, aliasList ); - case RFSS_STATUS_BROADCAST: - return new RFSSStatusBroadcastExtended( message, - duid, aliasList ); - case ROAMING_ADDRESS_UPDATE: - return new RoamingAddressUpdateExtended( - message, duid, aliasList ); - case STATUS_QUERY: - return new StatusQueryExtended( message, duid, - aliasList ); - case STATUS_UPDATE: - return new StatusUpdateExtended( message, duid, - aliasList ); - case TELEPHONE_INTERCONNECT_VOICE_CHANNEL_GRANT: - return new TelephoneInterconnectChannelGrantExplicit( - message, duid, aliasList ); - case TELEPHONE_INTERCONNECT_VOICE_CHANNEL_GRANT_UPDATE: - return new TelephoneInterconnectChannelGrantUpdateExplicit( - message, duid, aliasList ); - case UNIT_REGISTRATION_RESPONSE: - return new UnitRegistrationResponseExtended( - message, duid, aliasList ); - case UNIT_TO_UNIT_ANSWER_REQUEST: - return new UnitToUnitAnswerRequestExplicit( - message, duid, aliasList ); - case UNIT_TO_UNIT_VOICE_CHANNEL_GRANT: - return new UnitToUnitVoiceChannelGrantExtended( - message, duid, aliasList ); - case UNIT_TO_UNIT_VOICE_CHANNEL_GRANT_UPDATE: - return new UnitToUnitVoiceChannelGrantUpdateExtended( - message, duid, aliasList ); - default: - break; - } - case MOTOROLA: - break; - default: - break; - } - - return new PDUMessage( message, duid, aliasList ); - - case UNCONFIRMED_MULTI_BLOCK_TRUNKING_CONTROL: - return new PDUMessage( message, duid, aliasList ); - default: - return new PDUMessage( message, duid, aliasList ); - } - } -} diff --git a/src/module/decode/p25/message/pdu/osp/data/IndividualDataChannelGrantExtended.java b/src/module/decode/p25/message/pdu/osp/data/IndividualDataChannelGrantExtended.java deleted file mode 100644 index 8b641093..00000000 --- a/src/module/decode/p25/message/pdu/osp/data/IndividualDataChannelGrantExtended.java +++ /dev/null @@ -1,25 +0,0 @@ -package module.decode.p25.message.pdu.osp.data; - -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.pdu.UnitToUnitChannelGrantExtended; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class IndividualDataChannelGrantExtended - extends UnitToUnitChannelGrantExtended - implements IdentifierReceiver -{ - public IndividualDataChannelGrantExtended( BinaryMessage message, - DataUnitID duid, AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.INDIVIDUAL_DATA_CHANNEL_GRANT.getDescription(); - } -} diff --git a/src/module/decode/p25/message/pdu/osp/voice/TelephoneInterconnectChannelGrantUpdateExplicit.java b/src/module/decode/p25/message/pdu/osp/voice/TelephoneInterconnectChannelGrantUpdateExplicit.java deleted file mode 100644 index 67f92214..00000000 --- a/src/module/decode/p25/message/pdu/osp/voice/TelephoneInterconnectChannelGrantUpdateExplicit.java +++ /dev/null @@ -1,22 +0,0 @@ -package module.decode.p25.message.pdu.osp.voice; - -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class TelephoneInterconnectChannelGrantUpdateExplicit - extends TelephoneInterconnectChannelGrantExplicit -{ - public TelephoneInterconnectChannelGrantUpdateExplicit( BinaryMessage message, - DataUnitID duid, AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.TELEPHONE_INTERCONNECT_VOICE_CHANNEL_GRANT_UPDATE.getDescription(); - } -} diff --git a/src/module/decode/p25/message/pdu/osp/voice/UnitToUnitVoiceChannelGrantExtended.java b/src/module/decode/p25/message/pdu/osp/voice/UnitToUnitVoiceChannelGrantExtended.java deleted file mode 100644 index f9542589..00000000 --- a/src/module/decode/p25/message/pdu/osp/voice/UnitToUnitVoiceChannelGrantExtended.java +++ /dev/null @@ -1,25 +0,0 @@ -package module.decode.p25.message.pdu.osp.voice; - -import module.decode.p25.message.IdentifierReceiver; -import module.decode.p25.message.pdu.UnitToUnitChannelGrantExtended; -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class UnitToUnitVoiceChannelGrantExtended - extends UnitToUnitChannelGrantExtended - implements IdentifierReceiver -{ - public UnitToUnitVoiceChannelGrantExtended( BinaryMessage message, - DataUnitID duid, AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.UNIT_TO_UNIT_VOICE_CHANNEL_GRANT.getDescription(); - } -} diff --git a/src/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectVoiceChannelGrantUpdate.java b/src/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectVoiceChannelGrantUpdate.java deleted file mode 100644 index 02622b73..00000000 --- a/src/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectVoiceChannelGrantUpdate.java +++ /dev/null @@ -1,23 +0,0 @@ -package module.decode.p25.message.tsbk.osp.voice; - -import module.decode.p25.reference.DataUnitID; -import module.decode.p25.reference.Opcode; -import alias.AliasList; -import bits.BinaryMessage; - -public class TelephoneInterconnectVoiceChannelGrantUpdate - extends TelephoneInterconnectVoiceChannelGrant -{ - - public TelephoneInterconnectVoiceChannelGrantUpdate( BinaryMessage message, - DataUnitID duid, AliasList aliasList ) - { - super( message, duid, aliasList ); - } - - @Override - public String getEventType() - { - return Opcode.TELEPHONE_INTERCONNECT_VOICE_CHANNEL_GRANT_UPDATE.getDescription(); - } -} diff --git a/src/module/log/config/EventLogConfiguration.java b/src/module/log/config/EventLogConfiguration.java deleted file mode 100644 index c575301b..00000000 --- a/src/module/log/config/EventLogConfiguration.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package module.log.config; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import module.log.EventLogType; -import controller.config.Configuration; - -@XmlRootElement( name = "event_log_configuration" ) -public class EventLogConfiguration extends Configuration -{ - protected List mLoggers = new ArrayList(); - - public EventLogConfiguration() - { - } - - @XmlElement( name = "logger" ) - public List getLoggers() - { - return mLoggers; - } - - public void setLoggers( ArrayList loggers ) - { - mLoggers = loggers; - } - - public void addLogger( EventLogType logger ) - { - mLoggers.add( logger ); - } - - public void clear() - { - mLoggers.clear(); - } -} diff --git a/src/network.java b/src/network.java deleted file mode 100644 index b7a93210..00000000 --- a/src/network.java +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************* - * sdrtrunk - * 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 - * - ******************************************************************************/ -public class network -{ -} diff --git a/src/playlist/PlaylistV2.java b/src/playlist/PlaylistV2.java deleted file mode 100644 index 584ba6f6..00000000 --- a/src/playlist/PlaylistV2.java +++ /dev/null @@ -1,87 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package playlist; - -import alias.Alias; -import audio.broadcast.BroadcastConfiguration; -import controller.channel.Channel; -import controller.channel.map.ChannelMap; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; -import java.util.ArrayList; -import java.util.List; - -@XmlSeeAlso( { Alias.class,Channel.class,ChannelMap.class,BroadcastConfiguration.class} ) -@XmlRootElement( name = "playlist" ) -public class PlaylistV2 -{ - private List mAliases = new ArrayList<>(); - private List mBroadcastConfigurations = new ArrayList<>(); - private List mChannels = new ArrayList<>(); - private List mChannelMaps = new ArrayList<>(); - - public PlaylistV2() - { - } - - @XmlElement( name = "alias" ) - public List getAliases() - { - return mAliases; - } - - public void setAliases( List aliases ) - { - mAliases = aliases; - } - - @XmlElement( name = "channel" ) - public List getChannels() - { - return mChannels; - } - - public void setChannels( List channels ) - { - mChannels = channels; - } - - @XmlElement( name = "channel_map" ) - public List getChannelMaps() - { - return mChannelMaps; - } - - public void setChannelMaps( List channelMaps ) - { - mChannelMaps = channelMaps; - } - - @XmlElement(name = "stream") - public List getBroadcastConfigurations() - { - return mBroadcastConfigurations; - } - - public void setBroadcastConfigurations(List configurations) - { - mBroadcastConfigurations = configurations; - } -} diff --git a/src/playlist/version1/AliasDirectory.java b/src/playlist/version1/AliasDirectory.java deleted file mode 100644 index 49c64eb7..00000000 --- a/src/playlist/version1/AliasDirectory.java +++ /dev/null @@ -1,91 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package playlist.version1; - -import java.util.ArrayList; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; - -import alias.AliasList; - -@XmlSeeAlso( { AliasList.class} ) -@XmlRootElement( name = "alias_directory" ) -@Deprecated -public class AliasDirectory -{ - private ArrayList mAliasList = new ArrayList<>(); - - public AliasDirectory() - { - } - - public void refresh() - { - } - - public void clearAliasLists() - { - mAliasList.clear(); - } - - @XmlElement( name = "alias_list" ) - public ArrayList getAliasList() - { - return mAliasList; - } - - public void setAliasList( ArrayList lists ) - { - mAliasList = lists; - - if( mAliasList == null ) - { - mAliasList = new ArrayList(); - } - } - - public void addAliasList( AliasListOld list ) - { - mAliasList.add( list ); - } - - public void removeAliasList( AliasListOld list ) - { - mAliasList.remove( list ); - } - - /** - * Gets the named alias list, or returns an empty alias list - */ - public AliasListOld getAliasList( String name ) - { - AliasListOld retVal = new AliasListOld( name ); - - for( AliasListOld list: mAliasList ) - { - if( list.getName().equalsIgnoreCase( name ) ) - { - return list; - } - } - - return retVal; - } -} diff --git a/src/playlist/version1/AliasListOld.java b/src/playlist/version1/AliasListOld.java deleted file mode 100644 index b3dc3908..00000000 --- a/src/playlist/version1/AliasListOld.java +++ /dev/null @@ -1,526 +0,0 @@ -/******************************************************************************* - * SDR Trunk - * Copyright (C) 2014,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 - ******************************************************************************/ -package playlist.version1; - -import alias.Alias; -import alias.action.AliasAction; -import alias.action.beep.BeepAction; -import alias.action.clip.ClipAction; -import alias.action.script.ScriptAction; -import alias.id.AliasID; -import alias.id.esn.Esn; -import alias.id.fleetsync.FleetsyncID; -import alias.id.lojack.LoJackFunctionAndID; -import alias.id.mdc.MDC1200ID; -import alias.id.mobileID.Min; -import alias.id.mpt1327.MPT1327ID; -import alias.id.nonrecordable.NonRecordable; -import alias.id.priority.Priority; -import alias.id.siteID.SiteID; -import alias.id.status.StatusID; -import alias.id.talkgroup.TalkgroupID; -import alias.id.uniqueID.UniqueID; -import module.decode.lj1200.LJ1200Message.Function; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; - -@XmlSeeAlso({Alias.class, - - /* Alias ID's */ - AliasID.class, - FleetsyncID.class, - Esn.class, - Group.class, - LoJackFunctionAndID.class, - MDC1200ID.class, - Min.class, - MPT1327ID.class, - UniqueID.class, - SiteID.class, - StatusID.class, - TalkgroupID.class, - - /* Alias Attributes */ - NonRecordable.class, - Priority.class, - - /* Alias Actions */ - AliasAction.class, - BeepAction.class, - ClipAction.class, - ScriptAction.class}) - -@Deprecated -@XmlRootElement(name = "alias_list") -public class AliasListOld implements Comparable -{ - private final static Logger mLog = LoggerFactory.getLogger(AliasListOld.class); - - private String mName; - private ArrayList mGroups = new ArrayList(); - - private Map mESN = new HashMap<>(); - private Map mFleetsync = new HashMap<>(); - private Map mLoJack = new HashMap<>(); - private Map mMDC1200 = new HashMap<>(); - private Map mMobileID = new HashMap<>(); - private Map mMPT1327 = new HashMap<>(); - private Map mSiteID = new HashMap<>(); - private Map mStatus = new HashMap<>(); - private Map mTalkgroup = new HashMap<>(); - private Map mUniqueID = new HashMap<>(); - - private boolean mESNWildcard = false; - private boolean mMobileIDWildcard = false; - private boolean mFleetsyncWildcard = false; - private boolean mMDC1200Wildcard = false; - private boolean mMPT1327Wildcard = false; - private boolean mSiteWildcard = false; - private boolean mTalkgroupWildcard = false; - - public AliasListOld() - { - this(null); - } - - public AliasListOld(String name) - { - mName = name; - update(); - } - - /** - * Load/Reload all lookup hashmaps - */ - public void update() - { - //Clear hashmaps - mESN.clear(); - mFleetsync.clear(); - mLoJack.clear(); - mMDC1200.clear(); - mMobileID.clear(); - mMPT1327.clear(); - mSiteID.clear(); - mStatus.clear(); - mTalkgroup.clear(); - mUniqueID.clear(); - - for(Group group : mGroups) - { - for(Alias alias : group.getAlias()) - { - for(AliasID id : alias.getId()) - { - switch(id.getType()) - { - case ESN: - Esn esn = (Esn) id; - if(esn.getEsn().contains("*")) - { - mESNWildcard = true; - - mESN.put(fixWildcard(esn.getEsn()), alias); - } - else - { - mESN.put(esn.getEsn(), alias); - } - break; - case FLEETSYNC: - FleetsyncID fs = (FleetsyncID) id; - - if(fs.getIdent().contains("*")) - { - mFleetsyncWildcard = true; - - mFleetsync.put(fixWildcard(fs.getIdent()), alias); - } - else - { - mFleetsync.put(fs.getIdent(), alias); - } - break; - case LOJACK: - mLoJack.put((LoJackFunctionAndID) id, alias); - break; - case MDC1200: - MDC1200ID mdc = (MDC1200ID) id; - - if(mdc.getIdent().contains("*")) - { - mMDC1200Wildcard = true; - - //Replace (*) wildcard with regex wildcard (.) - mMDC1200.put(fixWildcard(mdc.getIdent()), alias); - } - else - { - mMDC1200.put(mdc.getIdent(), alias); - } - break; - case MPT1327: - MPT1327ID mpt = (MPT1327ID) id; - - String ident = mpt.getIdent(); - - if(ident != null) - { - if(ident.contains("*")) - { - mMPT1327Wildcard = true; - - //Replace (*) wildcard with regex wildcard (.) - mMPT1327.put(fixWildcard(ident), alias); - } - else - { - mMPT1327.put(ident, alias); - } - } - break; - case MIN: - Min min = (Min) id; - - if(min.getMin().contains("*")) - { - mMobileIDWildcard = true; - mMobileID.put(fixWildcard(min.getMin()), alias); - } - else - { - mMobileID.put(min.getMin(), alias); - } - break; - case LTR_NET_UID: - UniqueID uid = (UniqueID) id; - - mUniqueID.put(uid.getUid(), alias); - break; - case SITE: - SiteID siteID = (SiteID) id; - - if(siteID.getSite().contains("*")) - { - mSiteWildcard = true; - mSiteID.put(fixWildcard(siteID.getSite()), alias); - } - else - { - mSiteID.put(siteID.getSite(), alias); - } - - break; - case STATUS: - mStatus.put(((StatusID) id).getStatus(), alias); - break; - case TALKGROUP: - TalkgroupID tgid = (TalkgroupID) id; - - if(tgid.getTalkgroup().contains("*")) - { - mTalkgroupWildcard = true; - - //Replace (*) wildcard with regex wildcard (.) - mTalkgroup.put(fixWildcard(tgid.getTalkgroup()), alias); - } - else - { - mTalkgroup.put(tgid.getTalkgroup(), alias); - } - break; - case NON_RECORDABLE: - case PRIORITY: - //We don't maintain lookups for these items - break; - default: - mLog.warn("Unrecognized Alias ID Type:" + id.getType().name()); - break; - } - } - } - } - } - - /** - * Converts user wildcard character (*) to regex single character wildcard (.) - * but ignores a regex multi-character wildcard (.*) - */ - private String fixWildcard(String value) - { - if(value.contains("*") && !value.contains(".*")) - { - return value.replace("*", "."); - } - - return value; - } - - public Alias getSiteID(String siteID) - { - if(siteID != null) - { - if(mSiteWildcard) - { - for(String regex : mSiteID.keySet()) - { - if(siteID.matches(regex)) - { - return mSiteID.get(regex); - } - } - } - else - { - return mSiteID.get(siteID); - } - } - - return null; - } - - public Alias getStatus(int status) - { - return mStatus.get(status); - } - - public Alias getUniqueID(int uniqueID) - { - return mUniqueID.get(uniqueID); - } - - public Alias getESNAlias(String esn) - { - if(esn != null) - { - if(mESNWildcard) - { - for(String regex : mESN.keySet()) - { - if(esn.matches(regex)) - { - return mESN.get(regex); - } - } - } - else - { - return mESN.get(esn); - } - } - - return null; - } - - - public Alias getFleetsyncAlias(String ident) - { - if(ident != null) - { - if(mFleetsyncWildcard) - { - for(String regex : mFleetsync.keySet()) - { - if(ident.matches(regex)) - { - return mFleetsync.get(regex); - } - } - } - else - { - return mFleetsync.get(ident); - } - } - - return null; - } - - public Alias getLoJackAlias(Function function, String id) - { - if(id != null) - { - for(LoJackFunctionAndID lojack : mLoJack.keySet()) - { - if(lojack.matches(function, id)) - { - return mLoJack.get(lojack); - } - } - } - - return null; - } - - public Alias getMDC1200Alias(String ident) - { - if(ident != null) - { - if(mMDC1200Wildcard) - { - for(String regex : mMDC1200.keySet()) - { - if(ident.matches(regex)) - { - return mMDC1200.get(regex); - } - } - } - else - { - return mMDC1200.get(ident); - } - } - - return null; - } - - public Alias getMPT1327Alias(String ident) - { - if(ident != null) - { - if(mMPT1327Wildcard) - { - for(String regex : mMPT1327.keySet()) - { - if(ident.matches(regex)) - { - return mMPT1327.get(regex); - } - } - } - else - { - return mMPT1327.get(ident); - } - } - - return null; - } - - public Group getGroup(Alias alias) - { - if(alias != null) - { - for(Group group : mGroups) - { - if(group.contains(alias)) - { - return group; - } - } - } - - return null; - } - - public Alias getMobileIDNumberAlias(String ident) - { - if(ident != null) - { - if(mMobileIDWildcard) - { - for(String regex : mMobileID.keySet()) - { - if(ident.matches(regex)) - { - return mMobileID.get(regex); - } - } - } - else - { - return mMobileID.get(ident); - } - } - - return null; - } - - public Alias getTalkgroupAlias(String tgid) - { - if(tgid != null) - { - if(mTalkgroupWildcard) - { - for(String regex : mTalkgroup.keySet()) - { - if(tgid.matches(regex)) - { - return mTalkgroup.get(regex); - } - } - } - else - { - return mTalkgroup.get(tgid); - } - } - - return null; - } - - public String toString() - { - return mName; - } - - @XmlAttribute - public String getName() - { - return mName; - } - - public void setName(String name) - { - mName = name; - } - - public ArrayList getGroup() - { - return mGroups; - } - - public void setGroup(ArrayList groups) - { - mGroups = groups; - } - - public void addGroup(Group group) - { - mGroups.add(group); - } - - public void removeGroup(Group group) - { - mGroups.remove(group); - } - - @Override - public int compareTo(AliasListOld otherAliasList) - { - return getName().compareTo(otherAliasList.getName()); - } -} diff --git a/src/playlist/version1/ChannelMapList.java b/src/playlist/version1/ChannelMapList.java deleted file mode 100644 index 5d0f6d61..00000000 --- a/src/playlist/version1/ChannelMapList.java +++ /dev/null @@ -1,79 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package playlist.version1; - -import java.util.ArrayList; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSeeAlso; - -import controller.channel.map.ChannelMap; - -@XmlSeeAlso( ChannelMap.class ) -@Deprecated -public class ChannelMapList -{ - private ArrayList mChannelMap = new ArrayList(); - - public ChannelMapList() - { - /* Empty constructor for JAXB */ - } - - @XmlElement( name = "channel_map" ) - public ArrayList getChannelMap() - { - return mChannelMap; - } - - public void setChannelMap( ArrayList ChannelMaps ) - { - mChannelMap = ChannelMaps; - } - - public void addChannelMap( ChannelMap ChannelMap ) - { - mChannelMap.add( ChannelMap ); - } - - public void removeChannelMap( ChannelMap ChannelMap ) - { - mChannelMap.remove( ChannelMap ); - } - - public void clearChannelMaps() - { - mChannelMap.clear(); - } - - /** - * Gets the named channel map, or returns an empty map - */ - public ChannelMap getChannelMap( String name ) - { - for( ChannelMap map: mChannelMap ) - { - if( map.getName().equalsIgnoreCase( name ) ) - { - return map; - } - } - - return new ChannelMap(); - } -} diff --git a/src/playlist/version1/Group.java b/src/playlist/version1/Group.java deleted file mode 100644 index d8a17d0f..00000000 --- a/src/playlist/version1/Group.java +++ /dev/null @@ -1,76 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package playlist.version1; - -import java.util.ArrayList; - -import javax.xml.bind.annotation.XmlAttribute; - -import alias.Alias; - -@Deprecated -public class Group -{ - private String mName; - private ArrayList mAliases = new ArrayList(); - - public Group() - { - } - - public String toString() - { - return "Group: " + mName; - } - - @XmlAttribute - public String getName() - { - return mName; - } - - public void setName( String name ) - { - mName = name; - } - - public ArrayList getAlias() - { - return mAliases; - } - - public void setAlias( ArrayList aliases ) - { - mAliases = aliases; - } - - public void addAlias( Alias alias ) - { - mAliases.add( alias ); - } - - public void removeAlias( Alias alias ) - { - mAliases.remove( alias ); - } - - public boolean contains( Alias alias ) - { - return mAliases.contains( alias ); - } -} diff --git a/src/playlist/version1/PlaylistConverterV1ToV2.java b/src/playlist/version1/PlaylistConverterV1ToV2.java deleted file mode 100644 index 2ed14fd4..00000000 --- a/src/playlist/version1/PlaylistConverterV1ToV2.java +++ /dev/null @@ -1,168 +0,0 @@ -package playlist.version1; - -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import playlist.PlaylistV2; -import alias.Alias; -import controller.channel.Channel; -import controller.channel.map.ChannelMap; - -public class PlaylistConverterV1ToV2 -{ - private final static Logger mLog = - LoggerFactory.getLogger( PlaylistConverterV1ToV2.class ); - - private PlaylistV2 mConvertedPlaylist; - private List mErrors = new ArrayList<>(); - - @SuppressWarnings( "deprecation" ) - public PlaylistConverterV1ToV2( Path path ) - { - PlaylistV1 playlistVersion1 = null; - - if( path != null && Files.exists( path ) ) - { - mLog.info( "attempting playlist v1 to v2 conversion [" + - path.toString() + "]" ); - - JAXBContext context = null; - - InputStream in = null; - - try - { - in = new FileInputStream( path.toString() ); - - try - { - context = JAXBContext.newInstance( PlaylistV1.class ); - - Unmarshaller m = context.createUnmarshaller(); - - playlistVersion1 = (PlaylistV1)m.unmarshal( in ); - } - catch ( JAXBException e ) - { - mErrors.add( "Couldn't unmarshall version 1 playlist - " + - e.getLocalizedMessage() ); - } - } - catch ( Exception e ) - { - mErrors.add( "Couldn't open version 1 playlist - [" + - path.toString() + "] - " + e.getLocalizedMessage() ); - } - finally - { - if( in != null ) - { - try - { - in.close(); - } - catch ( IOException e ) - { - mLog.error( "exception while closing " + - "the playlist file inputstream reader", e ); - } - } - } - } - else - { - mErrors.add( "version 1 playlist is null or not found [" + - path.toString() + "]" ); - } - - if( playlistVersion1 != null ) - { - mConvertedPlaylist = new PlaylistV2(); - - if( playlistVersion1.hasSystemList() ) - { - SystemList systemList = playlistVersion1.getSystemList(); - - for( playlist.version1.System system: systemList.getSystem() ) - { - for( Site site: system.getSite() ) - { - for( Channel channel: site.getChannel() ) - { - channel.setSystem( system.getName() ); - channel.setSite( site.getName() ); - - mConvertedPlaylist.getChannels().add( channel ); - } - } - } - } - - if( playlistVersion1.hasAliasDirectory() ) - { - AliasDirectory aliasDirectory = playlistVersion1.getAliasDirectory(); - - for( AliasListOld list: aliasDirectory.getAliasList() ) - { - for( Group group: list.getGroup() ) - { - for( Alias alias: group.getAlias() ) - { - alias.setList( list.getName() ); - alias.setGroup( group.getName() ); - - mConvertedPlaylist.getAliases().add( alias ); - } - } - } - } - - if( playlistVersion1.hasChannelMapList() ) - { - //Move the channel maps out of the channel map list - ChannelMapList channelMapList = playlistVersion1.getChannelMapList(); - - List channelMaps = channelMapList.getChannelMap(); - - if( channelMaps != null && !channelMaps.isEmpty() ) - { - mConvertedPlaylist.getChannelMaps().addAll( channelMaps ); - } - } - - mLog.info( "Converted [" + mConvertedPlaylist.getChannels().size() + - "] channels to new playlist format" ); - mLog.info( "Converted [" + mConvertedPlaylist.getAliases().size() + - "] aliases to new playlist format" ); - mLog.info( "Converted [" + mConvertedPlaylist.getChannelMaps().size() + - "] channel maps to new playlist format" ); - } - } - - public PlaylistV2 getConvertedPlaylist() - { - return mConvertedPlaylist; - } - - public List getErrorMessages() - { - return mErrors; - } - - public boolean hasErrorMessages() - { - return !mErrors.isEmpty(); - } -} diff --git a/src/playlist/version1/PlaylistV1.java b/src/playlist/version1/PlaylistV1.java deleted file mode 100644 index 52e8dc4a..00000000 --- a/src/playlist/version1/PlaylistV1.java +++ /dev/null @@ -1,106 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package playlist.version1; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; - -import alias.Alias; -import controller.channel.Channel; - -@XmlSeeAlso( { AliasDirectory.class, - Alias.class, - Channel.class, - ChannelMapList.class, - SystemList.class } ) - -@Deprecated -@XmlRootElement( name = "playlist" ) -public class PlaylistV1 -{ - //Note: these are for legacy version 1 format playlists - private AliasDirectory mAliasDirectory = new AliasDirectory(); - private ChannelMapList mChannelMapList = new ChannelMapList(); - private SystemList mSystemList = new SystemList(); - - public PlaylistV1() - { - } - - @XmlElement( name = "alias_directory" ) - public AliasDirectory getAliasDirectory() - { - mAliasDirectory.refresh(); - - return mAliasDirectory; - } - - - public void setAliasDirectory( AliasDirectory directory ) - { - mAliasDirectory = directory; - } - - public boolean hasAliasDirectory() - { - return mAliasDirectory != null && - mAliasDirectory.getAliasList() != null && - !mAliasDirectory.getAliasList().isEmpty(); - } - - - @XmlElement( name = "system_list" ) - public SystemList getSystemList() - { - return mSystemList; - } - - - public void setSystemList( SystemList list ) - { - mSystemList = list; - } - - public boolean hasSystemList() - { - return mSystemList != null && - mSystemList.getSystem() != null && - !mSystemList.getSystem().isEmpty(); - } - - - @XmlElement( name = "channel_maps" ) - public ChannelMapList getChannelMapList() - { - return mChannelMapList; - } - - public boolean hasChannelMapList() - { - return mChannelMapList != null && - mChannelMapList.getChannelMap() != null && - !mChannelMapList.getChannelMap().isEmpty(); - } - - - public void setChannelMapList( ChannelMapList list ) - { - mChannelMapList = list; - } -} diff --git a/src/playlist/version1/Site.java b/src/playlist/version1/Site.java deleted file mode 100644 index 876fc30b..00000000 --- a/src/playlist/version1/Site.java +++ /dev/null @@ -1,87 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package playlist.version1; - -import java.util.ArrayList; - -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; - -import controller.channel.Channel; - -@XmlSeeAlso( { Channel.class } ) -@XmlRootElement( name = "site" ) -@Deprecated -public class Site -{ - private String mName; - - private ArrayList mChannel = new ArrayList(); - - public Site() - { - this( "New Site" ); - } - - public Site( String name ) - { - mName = name; - } - - public String toString() - { - return mName; - } - - @XmlAttribute - public String getName() - { - return mName; - } - - public void setName( String name ) - { - mName = name; - } - - public ArrayList getChannel() - { - return mChannel; - } - - public void setChannel( ArrayList configs ) - { - mChannel = configs; - } - - public void addChannel( Channel channel ) - { - mChannel.add( channel ); - } - - public void removeChannel( Channel channel ) - { - mChannel.remove( channel ); - } - - public void removeAllChannels() - { - mChannel.clear(); - } -} diff --git a/src/playlist/version1/SystemList.java b/src/playlist/version1/SystemList.java deleted file mode 100644 index 0491f50e..00000000 --- a/src/playlist/version1/SystemList.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package playlist.version1; - -import java.util.ArrayList; - -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; - -@SuppressWarnings( "deprecation" ) -@XmlSeeAlso( { playlist.version1.System.class } ) - -@XmlRootElement( name = "system_list" ) -@Deprecated -public class SystemList -{ - private ArrayList mSystem = new ArrayList(); - - public SystemList() - { - } - - public ArrayList getSystem() - { - return mSystem; - } - - public void setSystem( ArrayList systems ) - { - mSystem = systems; - } - - public void addSystem( System system ) - { - mSystem.add( system ); - } - - public void removeSystem( System system ) - { - mSystem.remove( system ); - } - - public void clearSystems() - { - mSystem.clear(); - } -} diff --git a/src/settings/ColorSetting.java b/src/settings/ColorSetting.java deleted file mode 100644 index 16e8f88a..00000000 --- a/src/settings/ColorSetting.java +++ /dev/null @@ -1,191 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package settings; - -import java.awt.Color; - -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlTransient; - -public class ColorSetting extends Setting -{ - @SuppressWarnings( "unused" ) - private static final int NO_TRANSLUCENCY = 255; - private static final int SPECTRUM_TRANSLUCENCY = 128; - private static final int CONFIG_TRANSLUCENCY = 60; - - private String mRGB; - private int mAlpha; - private ColorSettingName mColorSettingName = ColorSettingName.UNKNOWN; - - public ColorSetting() - { - setColor( mColorSettingName.getDefaultColor() ); - } - - public ColorSetting( ColorSettingName name ) - { - setColor( name.getDefaultColor() ); - setColorSettingName( name ); - } - - @XmlAttribute - public ColorSettingName getColorSettingName() - { - return mColorSettingName; - } - - public void setColorSettingName( ColorSettingName name ) - { - mColorSettingName = name; - } - - @XmlAttribute - public String getRgb() - { - return mRGB; - } - - public void setRgb( String value ) - { - mRGB = value; - } - - @XmlAttribute - public int getAlpha() - { - return mAlpha; - } - - public void setAlpha( int value ) - { - mAlpha = value; - } - - @XmlTransient - public Color getColor() - { - Color temp = Color.decode( mRGB ); - - return new Color( temp.getRed(), - temp.getGreen(), - temp.getBlue(), - mAlpha ); - } - - public void setColor( Color color ) - { - mRGB = Integer.toHexString( color.getRGB() ); - mRGB = "#" + mRGB.substring( 2, mRGB.length() ); - mAlpha = color.getAlpha(); - } - - public static Color getTranslucent( Color color, int translucency ) - { - return new Color( color.getRed(), - color.getGreen(), - color.getBlue(), - translucency ); - } - - public enum ColorSettingName - { - CHANNEL_CONFIG( getTranslucent( Color.LIGHT_GRAY, CONFIG_TRANSLUCENCY ), - "Channel", "Channel Color" ), - CHANNEL_CONFIG_PROCESSING( getTranslucent( Color.GREEN, CONFIG_TRANSLUCENCY ), - "Channel Processing", "Processing Channel Color" ), - CHANNEL_CONFIG_SELECTED( getTranslucent( Color.BLUE, CONFIG_TRANSLUCENCY ), - "Channel Selected", "Selected Channel Color" ), - - CHANNEL_STATE_BACKGROUND( Color.BLACK, "Background", - "Channel State Background" ), - CHANNEL_STATE_GRADIENT_TOP_CALL( Color.BLACK, - "Call Gradient Top", "Channel Call State Gradient Top" ), - CHANNEL_STATE_GRADIENT_MIDDLE_CALL( Color.BLUE, - "Call Gradient Middle", "Channel Call State Gradient Middle" ), - CHANNEL_STATE_GRADIENT_TOP_CONTROL( Color.BLACK, - "Control Gradient Top", "Channel Control State Gradient Top" ), - CHANNEL_STATE_GRADIENT_MIDDLE_CONTROL( new Color( 0xC64F00 ), - "Control Gradient Middle", "Channel Control State Gradient Middle" ), - CHANNEL_STATE_GRADIENT_TOP_DATA( Color.BLACK, - "Data Gradient Top", "Channel Data State Gradient Top" ), - CHANNEL_STATE_GRADIENT_MIDDLE_DATA( new Color( 0xCC00CC ), - "Data Gradient Middle", "Channel Data State Gradient Middle" ), - CHANNEL_STATE_GRADIENT_TOP_FADE( Color.BLACK, - "Fade Gradient Top", "Channel Fade State Gradient Top" ), - CHANNEL_STATE_GRADIENT_MIDDLE_FADE( Color.DARK_GRAY, - "Fade Gradient Middle", "Channel Fade State Gradient Middle" ), - CHANNEL_STATE_GRADIENT_TOP_IDLE( Color.BLACK, - "Idle Gradient Top", "Channel Idle State Gradient Top" ), - CHANNEL_STATE_GRADIENT_MIDDLE_IDLE( Color.DARK_GRAY, - "Idle Gradient Middle", "Channel Idle State Gradient Middle" ), - CHANNEL_STATE_GRADIENT_TOP_NO_TUNER( Color.RED, - "No Tuner Gradient Top", "Channel No Tuner State Gradient Top" ), - CHANNEL_STATE_GRADIENT_MIDDLE_NO_TUNER( new Color( 0x990000 ), - "No Tuner Gradient Middle", "Channel No Tuner State Gradient Middle" ), - CHANNEL_STATE_LABEL_DETAILS( Color.LIGHT_GRAY, - "Details", "Details Label Color" ), - CHANNEL_STATE_LABEL_DECODER( Color.GREEN, - "Decoder", "Decoder Label Color" ), - CHANNEL_STATE_LABEL_AUX_DECODER( Color.YELLOW, - "Aux Decoder", "Aux Decoder Label Color" ), - CHANNEL_STATE_SELECTED_CHANNEL( Color.YELLOW, - "Selected Channel Indicator", "Selected Channel Indicator Color" ), - - SPECTRUM_BACKGROUND( Color.BLACK, - "Background", "Spectrum Background Color" ), - SPECTRUM_CURSOR( Color.ORANGE, - "Cursor", "Spectrum Cursor Color" ), - SPECTRUM_GRADIENT_BOTTOM( getTranslucent( Color.GREEN, SPECTRUM_TRANSLUCENCY ), - "Gradient Bottom", "Spectrum Gradient Bottom Color" ), - SPECTRUM_GRADIENT_TOP( getTranslucent( Color.WHITE, SPECTRUM_TRANSLUCENCY ), - "Gradient Top", "Spectrum Gradient Top Color" ), - SPECTRUM_LINE( getTranslucent( Color.LIGHT_GRAY, SPECTRUM_TRANSLUCENCY ), - "Line", "Spectrum Lines and Text Color" ), - - UNKNOWN( Color.RED, "Unknown", "Unknown Setting Color" ); - - private Color mDefaultColor; - private String mLabel; - private String mDialogTitle; - - private ColorSettingName( Color defaultColor, - String label, - String dialogTitle ) - { - mDefaultColor = defaultColor; - mLabel = label; - mDialogTitle = dialogTitle; - } - - public Color getDefaultColor() - { - return mDefaultColor; - } - - public String getLabel() - { - return mLabel; - } - - public String getDialogTitle() - { - return mDialogTitle; - } - } -} diff --git a/src/settings/FileSetting.java b/src/settings/FileSetting.java deleted file mode 100644 index d9e7e460..00000000 --- a/src/settings/FileSetting.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package settings; - -import java.io.File; - - -public class FileSetting extends Setting -{ - private String mPath; - - public FileSetting() - { - super(); - } - - public FileSetting( String name, String path ) - { - super( name ); - setPath( path ); - } - - public String getPath() - { - return mPath; - } - - public void setPath( String value ) - { - mPath = value; - } - - public File getFile() - { - return new File( mPath ); - } -} diff --git a/src/settings/MapViewSetting.java b/src/settings/MapViewSetting.java deleted file mode 100644 index 8e68239c..00000000 --- a/src/settings/MapViewSetting.java +++ /dev/null @@ -1,79 +0,0 @@ -package settings; - -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlTransient; - -import org.jdesktop.swingx.mapviewer.GeoPosition; - -public class MapViewSetting extends Setting -{ - private double mLatitude; - private double mLongitude; - private int mZoom; - - public MapViewSetting() - { - /* Empty constructor for JAXB */ - } - - public MapViewSetting( String name, double latitude, double longitude, int zoom ) - { - super( name ); - mLatitude = latitude; - mLongitude = longitude; - mZoom = zoom; - } - - public MapViewSetting( String name, GeoPosition position, int zoom ) - { - super( name ); - mLatitude = position.getLatitude(); - mLongitude = position.getLongitude(); - mZoom = zoom; - } - - @XmlAttribute - public double getLatitude() - { - return mLatitude; - } - - public void setLatitude( double latitude ) - { - mLatitude = latitude; - } - - @XmlAttribute - public double getLongitude() - { - return mLongitude; - } - - public void setLongitude( double longitude ) - { - mLongitude = longitude; - } - - @XmlAttribute - public int getZoom() - { - return mZoom; - } - - public void setZoom( int zoom ) - { - mZoom = zoom; - } - - @XmlTransient - public GeoPosition getGeoPosition() - { - return new GeoPosition( mLatitude, mLongitude ); - } - - public void setGeoPosition( GeoPosition position ) - { - mLatitude = position.getLatitude(); - mLongitude = position.getLongitude(); - } -} diff --git a/src/settings/Setting.java b/src/settings/Setting.java deleted file mode 100644 index 7bbf97a7..00000000 --- a/src/settings/Setting.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package settings; - -import javax.xml.bind.annotation.XmlAttribute; - -public class Setting -{ - protected String mName; - - public Setting() - { - } - - public Setting( String name ) - { - mName = name; - } - - @XmlAttribute - public String getName() - { - return mName; - } - - public void setName( String name ) - { - mName = name; - } -} diff --git a/src/settings/Settings.java b/src/settings/Settings.java deleted file mode 100644 index a7f2d261..00000000 --- a/src/settings/Settings.java +++ /dev/null @@ -1,236 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package settings; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; - -import map.DefaultIcon; -import map.MapIcon; -import settings.ColorSetting.ColorSettingName; -import source.recording.RecordingConfiguration; -import source.tuner.airspy.AirspyTunerConfiguration; -import source.tuner.configuration.TunerConfiguration; -import source.tuner.fcd.proV1.FCD1TunerConfiguration; -import source.tuner.fcd.proplusV2.FCD2TunerConfiguration; -import source.tuner.hackrf.HackRFTunerConfiguration; -import source.tuner.rtl.e4k.E4KTunerConfiguration; -import source.tuner.rtl.r820t.R820TTunerConfiguration; - -/** - * Support for persisting via JAXB all configured SDRTrunk settings - */ -@XmlSeeAlso( { AirspyTunerConfiguration.class, - ColorSetting.class, - DefaultIcon.class, - E4KTunerConfiguration.class, - FCD1TunerConfiguration.class, - FCD2TunerConfiguration.class, - FileSetting.class, - HackRFTunerConfiguration.class, - MapViewSetting.class, - MapIcon.class, - R820TTunerConfiguration.class, - RecordingConfiguration.class, - Setting.class, - TunerConfiguration.class } ) - -@XmlRootElement( name = "SDRTrunk_settings" ) -public class Settings -{ - private List mSettings = new ArrayList(); - - private List mTunerConfiguration = - new ArrayList(); - - private List mRecordingConfigurations = - new ArrayList(); - - public Settings() - { - } - - @XmlElement( name="recording_configuration" ) - public List getRecordingConfigurations() - { - return mRecordingConfigurations; - } - - public void setRecordingConfigurations( ArrayList configs ) - { - mRecordingConfigurations = configs; - } - - public void addRecordingConfiguration( RecordingConfiguration config ) - { - mRecordingConfigurations.add( config ); - } - - public void removeRecordingConfiguration( RecordingConfiguration config ) - { - mRecordingConfigurations.remove( config ); - } - - @XmlElement( name="tuner_configuration" ) - public List getTunerConfigurations() - { - return mTunerConfiguration; - } - - public void setTunerConfigurations( List configs ) - { - mTunerConfiguration = configs; - } - - @XmlElement( name="setting" ) - public List getSettings() - { - return mSettings; - } - - public void setSettings( ArrayList settings ) - { - mSettings = settings; - } - - public Setting getSetting( String name ) - { - for( Setting setting: mSettings ) - { - if( setting.getName().contentEquals( name ) ) - { - return setting; - } - } - - return null; - } - - public void addSetting( Setting setting ) - { - mSettings.add( setting ); - } - - public void removeSetting( Setting setting ) - { - mSettings.remove( setting ); - } - - public DefaultIcon getDefaultIcon() - { - for( Setting setting: mSettings ) - { - if( setting instanceof DefaultIcon ) - { - return (DefaultIcon)setting; - } - } - - return null; - } - - public ColorSetting getColorSetting( ColorSettingName name ) - { - for( Setting setting: mSettings ) - { - if( setting instanceof ColorSetting && - ((ColorSetting)setting).getColorSettingName() == name ) - { - return (ColorSetting)setting; - } - } - - return null; - } - - public List getColorSettings() - { - ArrayList colors = new ArrayList(); - - for( Setting setting: mSettings ) - { - if( setting instanceof ColorSetting ) - { - colors.add( (ColorSetting)setting ); - } - } - - return colors; - } - - public FileSetting getFileSetting( String name ) - { - for( Setting setting: mSettings ) - { - if( setting instanceof FileSetting && - setting.getName().contentEquals( name ) ) - { - return (FileSetting)setting; - } - } - - return null; - } - - public MapIcon getMapIcon( String name ) - { - for( Setting setting: mSettings ) - { - if( setting instanceof MapIcon && - setting.getName().contentEquals( name ) ) - { - return (MapIcon)setting; - } - } - - return null; - } - - public ArrayList getMapIcons() - { - ArrayList icons = new ArrayList(); - - for( Setting setting: mSettings ) - { - if( setting instanceof MapIcon ) - { - icons.add( (MapIcon)setting ); - } - } - - return icons; - } - - public MapViewSetting getMapViewSetting( String name ) - { - for( Setting setting: mSettings ) - { - if( setting instanceof MapViewSetting && - setting.getName().contentEquals( name ) ) - { - return (MapViewSetting)setting; - } - } - - return null; - } -} diff --git a/src/source/ComplexSource.java b/src/source/ComplexSource.java deleted file mode 100644 index e7e1939c..00000000 --- a/src/source/ComplexSource.java +++ /dev/null @@ -1,13 +0,0 @@ -package source; - -import sample.Provider; -import sample.SampleType; -import sample.complex.ComplexBuffer; - -public abstract class ComplexSource extends Source implements Provider -{ - public ComplexSource() - { - super( SampleType.COMPLEX ); - } -} diff --git a/src/source/RealSource.java b/src/source/RealSource.java deleted file mode 100644 index b512bfbc..00000000 --- a/src/source/RealSource.java +++ /dev/null @@ -1,14 +0,0 @@ -package source; - -import sample.Provider; -import sample.SampleType; -import sample.real.RealBuffer; - - -public abstract class RealSource extends Source implements Provider -{ - public RealSource() - { - super( SampleType.REAL ); - } -} diff --git a/src/source/config/SourceConfigMixer.java b/src/source/config/SourceConfigMixer.java deleted file mode 100644 index 01a9e1af..00000000 --- a/src/source/config/SourceConfigMixer.java +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package source.config; - -import javax.xml.bind.annotation.XmlAttribute; - -import source.SourceType; -import source.mixer.MixerChannel; - -public class SourceConfigMixer extends SourceConfiguration -{ - protected String mMixer; - protected MixerChannel mChannel = MixerChannel.LEFT; //default - - public SourceConfigMixer() - { - super( SourceType.MIXER ); - } - - @Override - public String getDescription() - { - return getName(); - } - - public String getName() - { - StringBuilder sb = new StringBuilder(); - - sb.append( "Mixer: " ); - sb.append( mMixer ); - sb.append( "-" ); - sb.append( mChannel.toString() ); - - return sb.toString(); - } - - @XmlAttribute( name= "mixer" ) - public String getMixer() - { - return mMixer; - } - - public void setMixer( String mixer ) - { - mMixer = mixer; - } - - @XmlAttribute( name = "channel" ) - public MixerChannel getChannel() - { - return mChannel; - } - - public void setChannel( MixerChannel channel ) - { - mChannel = channel; - } -} diff --git a/src/source/config/SourceConfigTuner.java b/src/source/config/SourceConfigTuner.java deleted file mode 100644 index d6d9a8d4..00000000 --- a/src/source/config/SourceConfigTuner.java +++ /dev/null @@ -1,69 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package source.config; - -import java.text.DecimalFormat; - -import javax.xml.bind.annotation.XmlAttribute; - -import source.SourceType; -import source.tuner.TunerChannel; -import source.tuner.TunerChannel.Type; - -public class SourceConfigTuner extends SourceConfiguration -{ - private static DecimalFormat sFORMAT = new DecimalFormat( "0.00000" ); - - private long mFrequency = 0; - private int mBandwidth = 12500; - - public SourceConfigTuner() - { - super( SourceType.TUNER ); - } - - public SourceConfigTuner( TunerChannel tunerChannel ) - { - this(); - - mFrequency = tunerChannel.getFrequency(); - mBandwidth = tunerChannel.getBandwidth(); - } - - @XmlAttribute( name = "frequency" ) - public long getFrequency() - { - return mFrequency; - } - - public void setFrequency( long frequency ) - { - mFrequency = frequency; - } - - @Override - public String getDescription() - { - return sFORMAT.format( (double)mFrequency / 1000000.0d ) + " MHz"; - } - - public TunerChannel getTunerChannel() - { - return new TunerChannel( Type.LOCKED, mFrequency, mBandwidth ); - } -} diff --git a/src/source/config/SourceConfiguration.java b/src/source/config/SourceConfiguration.java deleted file mode 100644 index a0b9433a..00000000 --- a/src/source/config/SourceConfiguration.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package source.config; - -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; - -import source.SourceType; -import controller.config.Configuration; - -@XmlSeeAlso( { SourceConfigMixer.class, SourceConfigNone.class, - SourceConfigTuner.class } ) -@XmlRootElement( name = "source_configuration" ) -public class SourceConfiguration extends Configuration -{ - protected SourceType mSourceType; - - public SourceConfiguration() - { - this( SourceType.NONE ); - } - - public SourceConfiguration( SourceType source ) - { - mSourceType = source; - } - - @XmlAttribute( name = "source_type" ) - public SourceType getSourceType() - { - return mSourceType; - } - - public void setSourceType( SourceType source ) - { - mSourceType = source; - } - - public String getDescription() - { - return "No Source"; - } -} diff --git a/src/source/recording/RecordingConfiguration.java b/src/source/recording/RecordingConfiguration.java deleted file mode 100644 index 25fd9333..00000000 --- a/src/source/recording/RecordingConfiguration.java +++ /dev/null @@ -1,87 +0,0 @@ -package source.recording; - -import java.io.File; - -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlTransient; - -public class RecordingConfiguration -{ - private File mRecording; - private String mFilePath; - private String mAlias; - private long mCenterFrequency; - - public RecordingConfiguration() - { - mAlias = "New Recording"; - } - - public RecordingConfiguration( String filePath, - String alias, - long centerFrequency ) - { - mFilePath = filePath; - mAlias = alias; - mCenterFrequency = centerFrequency; - - updateFile(); - } - - private void updateFile() - { - if( mFilePath != null ) - { - try - { - mRecording = new File( mFilePath ); - } - catch( Exception e ) - { - throw new IllegalArgumentException( "There was an error while " - + "accessing the recording source [" + mFilePath + "]", e ); - } - } - } - - @XmlTransient - public File getRecording() - { - return mRecording; - } - - @XmlAttribute( name = "file_path" ) - public String getFilePath() - { - return mFilePath; - } - - public void setFilePath( String filePath ) - { - mFilePath = filePath; - - updateFile(); - } - - @XmlAttribute( name = "alias" ) - public String getAlias() - { - return mAlias; - } - - public void setAlias( String alias ) - { - mAlias = alias; - } - - @XmlAttribute( name = "center_frequency" ) - public long getCenterFrequency() - { - return mCenterFrequency; - } - - public void setCenterFrequency( long frequency ) - { - mCenterFrequency = frequency; - } -} diff --git a/src/source/tuner/airspy/AirspyTunerConfiguration.java b/src/source/tuner/airspy/AirspyTunerConfiguration.java deleted file mode 100644 index 9a62bdbe..00000000 --- a/src/source/tuner/airspy/AirspyTunerConfiguration.java +++ /dev/null @@ -1,144 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package source.tuner.airspy; - -import javax.xml.bind.annotation.XmlAttribute; - -import source.tuner.TunerType; -import source.tuner.airspy.AirspyTunerController.Gain; -import source.tuner.configuration.TunerConfiguration; - -public class AirspyTunerConfiguration extends TunerConfiguration -{ - private int mSampleRate = AirspyTunerController.DEFAULT_SAMPLE_RATE.getRate(); - private Gain mGain = AirspyTunerController.LINEARITY_GAIN_DEFAULT; - private int mIFGain = AirspyTunerController.IF_GAIN_DEFAULT; - private int mMixerGain = AirspyTunerController.MIXER_GAIN_DEFAULT; - private int mLNAGain = AirspyTunerController.LNA_GAIN_DEFAULT; - private double mFrequencyCorrection = 0.0d; - - private boolean mMixerAGC = false; - private boolean mLNAAGC = false; - - /** - * Default constructor for JAXB - */ - public AirspyTunerConfiguration() - { - } - - public AirspyTunerConfiguration( String uniqueID, String name ) - { - super( uniqueID, name ); - } - - @Override - public TunerType getTunerType() - { - return TunerType.AIRSPY_R820T; - } - - @XmlAttribute( name = "sample_rate" ) - public int getSampleRate() - { - return mSampleRate; - } - - public void setSampleRate( int sampleRate ) - { - mSampleRate = sampleRate; - } - - @XmlAttribute( name = "gain" ) - public Gain getGain() - { - return mGain; - } - - public void setGain( Gain gain ) - { - mGain = gain; - } - - @XmlAttribute( name = "if_gain" ) - public int getIFGain() - { - return mIFGain; - } - - public void setIFGain( int gain ) - { - mIFGain = gain; - } - - @XmlAttribute( name = "mixer_gain" ) - public int getMixerGain() - { - return mMixerGain; - } - - public void setMixerGain( int gain ) - { - mMixerGain = gain; - } - - @XmlAttribute( name = "lna_gain" ) - public int getLNAGain() - { - return mLNAGain; - } - - public void setLNAGain( int gain ) - { - mLNAGain = gain; - } - - @XmlAttribute( name = "mixer_agc" ) - public boolean isMixerAGC() - { - return mMixerAGC; - } - - public void setMixerAGC( boolean enabled ) - { - mMixerAGC = enabled; - } - - @XmlAttribute( name = "lna_agc" ) - public boolean isLNAAGC() - { - return mLNAAGC; - } - - public void setLNAAGC( boolean enabled ) - { - mLNAAGC = enabled; - } - - @XmlAttribute( name = "frequency_correction" ) - public double getFrequencyCorrection() - { - return mFrequencyCorrection; - } - - public void setFrequencyCorrection( double value ) - { - mFrequencyCorrection = value; - } - -} diff --git a/src/source/tuner/configuration/TunerConfiguration.java b/src/source/tuner/configuration/TunerConfiguration.java deleted file mode 100644 index fc0501ef..00000000 --- a/src/source/tuner/configuration/TunerConfiguration.java +++ /dev/null @@ -1,103 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package source.tuner.configuration; - -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - -import source.tuner.TunerType; - -/** - * Abstract class to hold a named configuration for a specific type of tuner - */ -@XmlType( name = "tuner_configuration" ) -public abstract class TunerConfiguration -{ - protected String mName; - protected String mUniqueID; - protected boolean mAssigned; - protected long mFrequency; - - /** - * Default constructor to support JAXB - */ - public TunerConfiguration() - { - } - - /** - * Normal constructor - */ - public TunerConfiguration( String uniqueID, String name ) - { - mUniqueID = uniqueID; - mName = name; - } - - public String toString() - { - return mName; - } - - @XmlAttribute( name = "name" ) - public String getName() - { - return mName; - } - - public void setName( String name ) - { - mName = name; - } - - @XmlAttribute( name = "unique_id" ) - public String getUniqueID() - { - return mUniqueID; - } - - public void setUniqueID( String id ) - { - mUniqueID = id;; - } - - @XmlAttribute( name = "assigned" ) - public boolean isAssigned() - { - return mAssigned; - } - - public void setAssigned( boolean assigned ) - { - mAssigned = assigned; - } - - @XmlAttribute( name = "frequency" ) - public long getFrequency() - { - return mFrequency; - } - - public void setFrequency( long frequency ) - { - mFrequency = frequency; - } - - @XmlAttribute( name = "tuner_type" ) - public abstract TunerType getTunerType(); -} diff --git a/src/source/tuner/fcd/proV1/FCD1TunerConfiguration.java b/src/source/tuner/fcd/proV1/FCD1TunerConfiguration.java deleted file mode 100644 index b045893f..00000000 --- a/src/source/tuner/fcd/proV1/FCD1TunerConfiguration.java +++ /dev/null @@ -1,145 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package source.tuner.fcd.proV1; - -import javax.xml.bind.annotation.XmlAttribute; - -import source.tuner.TunerType; -import source.tuner.configuration.TunerConfiguration; -import source.tuner.fcd.proV1.FCD1TunerController.LNAEnhance; -import source.tuner.fcd.proV1.FCD1TunerController.LNAGain; -import source.tuner.fcd.proV1.FCD1TunerController.MixerGain; - -public class FCD1TunerConfiguration extends TunerConfiguration -{ - private double mFrequencyCorrection = 22.0d; - private double mInphaseDCCorrection = 0.0d; - private double mQuadratureDCCorrection = 0.0d; - private double mPhaseCorrection = 0.0d; - private double mGainCorrection = 0.0d; - - private LNAGain mLNAGain = LNAGain.LNA_GAIN_PLUS_20_0; - private LNAEnhance mLNAEnhance = LNAEnhance.LNA_ENHANCE_OFF; - private MixerGain mMixerGain = MixerGain.MIXER_GAIN_PLUS_12_0; - - /** - * Default constructor for JAXB - */ - public FCD1TunerConfiguration() - { - } - - public FCD1TunerConfiguration( String uniqueID, String name ) - { - super( uniqueID, name ); - } - - @Override - public TunerType getTunerType() - { - return TunerType.FUNCUBE_DONGLE_PRO; - } - - @XmlAttribute( name = "lna_gain" ) - public LNAGain getLNAGain() - { - return mLNAGain; - } - - public void setLNAGain( LNAGain gain ) - { - mLNAGain = gain; - } - - public LNAEnhance getLNAEnhance() - { - return mLNAEnhance; - } - - @XmlAttribute( name = "lna_enhance" ) - public void setLNAEnhance( LNAEnhance enhance ) - { - mLNAEnhance = enhance; - } - - @XmlAttribute( name = "mixer_gain" ) - public MixerGain getMixerGain() - { - return mMixerGain; - } - - public void setMixerGain( MixerGain gain ) - { - mMixerGain = gain; - } - - @XmlAttribute( name = "frequency_correction" ) - public double getFrequencyCorrection() - { - return mFrequencyCorrection; - } - - public void setFrequencyCorrection( double value ) - { - mFrequencyCorrection = value; - } - - @XmlAttribute( name = "inphase_dc_correction" ) - public double getInphaseDCCorrection() - { - return mInphaseDCCorrection; - } - - public void setInphaseDCCorrection( double value ) - { - mInphaseDCCorrection = value; - } - - @XmlAttribute( name = "quadrature_dc_correction" ) - public double getQuadratureDCCorrection() - { - return mQuadratureDCCorrection; - } - - public void setQuadratureDCCorrection( double value ) - { - mQuadratureDCCorrection = value; - } - - @XmlAttribute( name = "phase_correction" ) - public double getPhaseCorrection() - { - return mPhaseCorrection; - } - - public void setPhaseCorrection( double value ) - { - mPhaseCorrection = value; - } - - @XmlAttribute( name = "gain_correction" ) - public double getGainCorrection() - { - return mGainCorrection; - } - - public void setGainCorrection( double value ) - { - mGainCorrection = value; - } -} diff --git a/src/source/tuner/fcd/proplusV2/FCD2TunerConfiguration.java b/src/source/tuner/fcd/proplusV2/FCD2TunerConfiguration.java deleted file mode 100644 index 0f001b13..00000000 --- a/src/source/tuner/fcd/proplusV2/FCD2TunerConfiguration.java +++ /dev/null @@ -1,81 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package source.tuner.fcd.proplusV2; - -import javax.xml.bind.annotation.XmlAttribute; - -import source.tuner.TunerType; -import source.tuner.configuration.TunerConfiguration; - -public class FCD2TunerConfiguration extends TunerConfiguration -{ - private boolean mGainLNA = true; - private boolean mGainMixer = true; - private double mFrequencyCorrection = -2.2d; - - /** - * Default constructor for JAXB - */ - public FCD2TunerConfiguration() - { - } - - public FCD2TunerConfiguration( String uniqueID, String name ) - { - super( uniqueID, name ); - } - - @Override - public TunerType getTunerType() - { - return TunerType.FUNCUBE_DONGLE_PRO_PLUS; - } - - @XmlAttribute( name = "lna_gain" ) - public boolean getGainLNA() - { - return mGainLNA; - } - - public void setGainLNA( boolean gain ) - { - mGainLNA = gain; - } - - @XmlAttribute( name = "mixer_gain" ) - public boolean getGainMixer() - { - return mGainMixer; - } - - public void setGainMixer( boolean gain ) - { - mGainMixer = gain; - } - - @XmlAttribute( name = "frequency_correction" ) - public double getFrequencyCorrection() - { - return mFrequencyCorrection; - } - - public void setFrequencyCorrection( double value ) - { - mFrequencyCorrection = value; - } -} diff --git a/src/source/tuner/hackrf/HackRFTunerConfiguration.java b/src/source/tuner/hackrf/HackRFTunerConfiguration.java deleted file mode 100644 index 14cd6a66..00000000 --- a/src/source/tuner/hackrf/HackRFTunerConfiguration.java +++ /dev/null @@ -1,109 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package source.tuner.hackrf; - - -import javax.xml.bind.annotation.XmlAttribute; - -import source.tuner.TunerType; -import source.tuner.configuration.TunerConfiguration; -import source.tuner.hackrf.HackRFTunerController.HackRFLNAGain; -import source.tuner.hackrf.HackRFTunerController.HackRFSampleRate; -import source.tuner.hackrf.HackRFTunerController.HackRFVGAGain; - -public class HackRFTunerConfiguration extends TunerConfiguration -{ - private HackRFSampleRate mSampleRate = HackRFSampleRate.RATE2_016MHZ; - private HackRFLNAGain mLNAGain = HackRFLNAGain.GAIN_16; - private HackRFVGAGain mVGAGain = HackRFVGAGain.GAIN_10; - private boolean mAmplifierEnabled = true; - private double mFrequencyCorrection = 0.0d; - - /** - * Default constructor for JAXB - */ - public HackRFTunerConfiguration() - { - } - - public HackRFTunerConfiguration( String uniqueID, String name ) - { - super( uniqueID, name ); - } - - @Override - public TunerType getTunerType() - { - return TunerType.HACKRF; - } - - @XmlAttribute( name = "amplifier_enabled" ) - public boolean getAmplifierEnabled() - { - return mAmplifierEnabled; - } - - public void setAmplifierEnabled( boolean enabled ) - { - mAmplifierEnabled = enabled; - } - - @XmlAttribute( name = "lna_gain" ) - public HackRFLNAGain getLNAGain() - { - return mLNAGain; - } - - public void setLNAGain( HackRFLNAGain lnaGain ) - { - mLNAGain = lnaGain; - } - - @XmlAttribute( name = "vga_gain" ) - public HackRFVGAGain getVGAGain() - { - return mVGAGain; - } - - public void setVGAGain( HackRFVGAGain vgaGain ) - { - mVGAGain = vgaGain; - } - - @XmlAttribute( name = "frequency_correction" ) - public double getFrequencyCorrection() - { - return mFrequencyCorrection; - } - - public void setFrequencyCorrection( double value ) - { - mFrequencyCorrection = value; - } - - @XmlAttribute( name = "sample_rate" ) - public HackRFSampleRate getSampleRate() - { - return mSampleRate; - } - - public void setSampleRate( HackRFSampleRate sampleRate ) - { - mSampleRate = sampleRate; - } -} diff --git a/src/source/tuner/rtl/e4k/E4KTunerConfiguration.java b/src/source/tuner/rtl/e4k/E4KTunerConfiguration.java deleted file mode 100644 index 3d4c9eff..00000000 --- a/src/source/tuner/rtl/e4k/E4KTunerConfiguration.java +++ /dev/null @@ -1,123 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package source.tuner.rtl.e4k; - -import javax.xml.bind.annotation.XmlAttribute; - -import source.tuner.TunerType; -import source.tuner.configuration.TunerConfiguration; -import source.tuner.rtl.RTL2832TunerController.SampleRate; -import source.tuner.rtl.e4k.E4KTunerController.E4KEnhanceGain; -import source.tuner.rtl.e4k.E4KTunerController.E4KGain; -import source.tuner.rtl.e4k.E4KTunerController.E4KLNAGain; -import source.tuner.rtl.e4k.E4KTunerController.E4KMixerGain; - -public class E4KTunerConfiguration extends TunerConfiguration -{ - private E4KGain mMasterGain = E4KGain.MANUAL; - private E4KMixerGain mMixerGain = E4KMixerGain.GAIN_4; - private E4KLNAGain mLNAGain = E4KLNAGain.GAIN_PLUS_200; - private E4KEnhanceGain mEnhanceGain = E4KEnhanceGain.GAIN_3; - private double mFrequencyCorrection = 0.0d; - private SampleRate mSampleRate = SampleRate.RATE_2_400MHZ; - - /** - * Default constructor for JAXB - */ - public E4KTunerConfiguration() - { - } - - public E4KTunerConfiguration( String uniqueID, String name ) - { - super( uniqueID, name ); - } - - @Override - public TunerType getTunerType() - { - return TunerType.ELONICS_E4000; - } - - @XmlAttribute( name="master_gain" ) - public E4KGain getMasterGain() - { - return mMasterGain; - } - - public void setMasterGain( E4KGain gain ) - { - mMasterGain = gain; - } - - @XmlAttribute( name="mixer_gain" ) - public E4KMixerGain getMixerGain() - { - return mMixerGain; - } - - public void setMixerGain( E4KMixerGain mixerGain ) - { - mMixerGain = mixerGain; - } - - @XmlAttribute( name="lna_gain" ) - public E4KLNAGain getLNAGain() - { - return mLNAGain; - } - - public void setLNAGain( E4KLNAGain lnaGain ) - { - mLNAGain = lnaGain; - } - - @XmlAttribute( name="enhance_gain" ) - public E4KEnhanceGain getEnhanceGain() - { - return mEnhanceGain; - } - - public void setEnhanceGain( E4KEnhanceGain enhanceGain ) - { - mEnhanceGain = enhanceGain; - } - - @XmlAttribute( name="frequency_correction" ) - public double getFrequencyCorrection() - { - return mFrequencyCorrection; - } - - public void setFrequencyCorrection( double value ) - { - mFrequencyCorrection = value; - } - - @XmlAttribute( name="sample_rate" ) - public SampleRate getSampleRate() - { - return mSampleRate; - } - - public void setSampleRate( SampleRate sampleRate ) - { - mSampleRate = sampleRate; - } - -} diff --git a/src/source/tuner/rtl/r820t/.directory b/src/source/tuner/rtl/r820t/.directory deleted file mode 100644 index 93d3d305..00000000 --- a/src/source/tuner/rtl/r820t/.directory +++ /dev/null @@ -1,4 +0,0 @@ -[Dolphin] -Timestamp=2014,5,10,7,19,1 -Version=3 -ViewMode=1 diff --git a/src/source/tuner/rtl/r820t/R820TTunerConfiguration.java b/src/source/tuner/rtl/r820t/R820TTunerConfiguration.java deleted file mode 100644 index f1d92e1a..00000000 --- a/src/source/tuner/rtl/r820t/R820TTunerConfiguration.java +++ /dev/null @@ -1,122 +0,0 @@ -/******************************************************************************* - * 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 - ******************************************************************************/ -package source.tuner.rtl.r820t; - -import javax.xml.bind.annotation.XmlAttribute; - -import source.tuner.TunerType; -import source.tuner.configuration.TunerConfiguration; -import source.tuner.rtl.RTL2832TunerController.SampleRate; -import source.tuner.rtl.r820t.R820TTunerController.R820TGain; -import source.tuner.rtl.r820t.R820TTunerController.R820TLNAGain; -import source.tuner.rtl.r820t.R820TTunerController.R820TMixerGain; -import source.tuner.rtl.r820t.R820TTunerController.R820TVGAGain; - -public class R820TTunerConfiguration extends TunerConfiguration -{ - private R820TGain mMasterGain = R820TGain.GAIN_327; - private R820TMixerGain mMixerGain = R820TMixerGain.GAIN_105; - private R820TLNAGain mLNAGain = R820TLNAGain.GAIN_222; - private R820TVGAGain mVGAGain = R820TVGAGain.GAIN_210; - private double mFrequencyCorrection = 0.0d; - private SampleRate mSampleRate = SampleRate.RATE_2_400MHZ; - - /** - * Default constructor for JAXB - */ - public R820TTunerConfiguration() - { - } - - public R820TTunerConfiguration( String uniqueID, String name ) - { - super( uniqueID, name ); - } - - @Override - public TunerType getTunerType() - { - return TunerType.RAFAELMICRO_R820T; - } - - @XmlAttribute( name = "master_gain" ) - public R820TGain getMasterGain() - { - return mMasterGain; - } - - public void setMasterGain( R820TGain gain ) - { - mMasterGain = gain; - } - - @XmlAttribute( name = "mixer_gain" ) - public R820TMixerGain getMixerGain() - { - return mMixerGain; - } - - public void setMixerGain( R820TMixerGain mixerGain ) - { - mMixerGain = mixerGain; - } - - @XmlAttribute( name = "lna_gain" ) - public R820TLNAGain getLNAGain() - { - return mLNAGain; - } - - public void setLNAGain( R820TLNAGain lnaGain ) - { - mLNAGain = lnaGain; - } - - @XmlAttribute( name = "vga_gain" ) - public R820TVGAGain getVGAGain() - { - return mVGAGain; - } - - public void setVGAGain( R820TVGAGain vgaGain ) - { - mVGAGain = vgaGain; - } - - @XmlAttribute( name = "frequency_correction" ) - public double getFrequencyCorrection() - { - return mFrequencyCorrection; - } - - public void setFrequencyCorrection( double value ) - { - mFrequencyCorrection = value; - } - - @XmlAttribute( name = "sample_rate" ) - public SampleRate getSampleRate() - { - return mSampleRate; - } - - public void setSampleRate( SampleRate sampleRate ) - { - mSampleRate = sampleRate; - } -} diff --git a/src/spectrum/.directory b/src/spectrum/.directory deleted file mode 100644 index 18c505d9..00000000 --- a/src/spectrum/.directory +++ /dev/null @@ -1,4 +0,0 @@ -[Dolphin] -Timestamp=2014,2,4,19,35,46 -Version=3 -ViewMode=1