diff --git a/.idea/libraries/jump3r_1_0_3.xml b/.idea/libraries/jump3r_1_0_3.xml new file mode 100644 index 00000000..7b55f0d4 --- /dev/null +++ b/.idea/libraries/jump3r_1_0_3.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 00000000..e96534fb --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/imports/jump3r-1.0.3.jar b/imports/jump3r-1.0.3.jar new file mode 100644 index 00000000..12d8234a Binary files /dev/null and b/imports/jump3r-1.0.3.jar differ diff --git a/sdrtrunk.iml b/sdrtrunk.iml index 4ceeed69..1c1d0bed 100644 --- a/sdrtrunk.iml +++ b/sdrtrunk.iml @@ -21,5 +21,6 @@ + \ No newline at end of file diff --git a/src/audio/stream/Stream.java b/src/audio/stream/Stream.java new file mode 100644 index 00000000..2ab62edd --- /dev/null +++ b/src/audio/stream/Stream.java @@ -0,0 +1,55 @@ +/******************************************************************************* + * 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 + * + ******************************************************************************/ +package audio.stream; + +import audio.AudioPacket; +import audio.stream.shout.channel.IShoutChannel; +import audio.stream.shout.server.IShoutServer; +import sample.Listener; + +/** + * Streaming channel encapsulates communication with a specific server and channel. + */ +public class Stream implements Listener +{ + private IShoutServer mServer; + private IShoutChannel mChannel; + + public Stream(IShoutServer server, IShoutChannel channel) + { + mServer = server; + mChannel = channel; + } + + public IShoutServer getServer() + { + return mServer; + } + + public IShoutChannel getChannel() + { + return mChannel; + } + + @Override + public void receive(AudioPacket audioPacket) + { + + } +} diff --git a/src/audio/stream/StreamManager.java b/src/audio/stream/StreamManager.java new file mode 100644 index 00000000..a1a87ca4 --- /dev/null +++ b/src/audio/stream/StreamManager.java @@ -0,0 +1,46 @@ +/******************************************************************************* + * 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 + * + ******************************************************************************/ +package audio.stream; + +import audio.AudioPacket; +import audio.IAudioPacketListener; +import controller.ThreadPoolManager; +import sample.Listener; + +public class StreamManager implements IAudioPacketListener, Listener +{ + private ThreadPoolManager mThreadPoolManager; + + public StreamManager(ThreadPoolManager threadPoolManager) + { + mThreadPoolManager = threadPoolManager; + } + + @Override + public void receive(AudioPacket audioPacket) + { + + } + + @Override + public Listener getAudioPacketListener() + { + return this; + } +} diff --git a/src/audio/stream/StreamModel.java b/src/audio/stream/StreamModel.java new file mode 100644 index 00000000..9e6b99ed --- /dev/null +++ b/src/audio/stream/StreamModel.java @@ -0,0 +1,86 @@ +/******************************************************************************* + * 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 + * + ******************************************************************************/ +package audio.stream; + +import javax.swing.table.AbstractTableModel; +import java.util.ArrayList; +import java.util.List; + +public class StreamModel extends AbstractTableModel +{ + private static final int COLUMN_CHANNEL_NAME = 0; + private static final int COLUMN_CHANNEL_FORMAT = 1; + private static final int COLUMN_SERVER_NAME = 2; + + private List mStreams = new ArrayList<>(); + + @Override + public int getRowCount() + { + return mStreams.size(); + } + + @Override + public int getColumnCount() + { + return 3; + } + + @Override + public Object getValueAt(int rowIndex, int columnIndex) + { + if( rowIndex <= mStreams.size()) + { + Stream stream = mStreams.get(rowIndex); + + if(stream != null) + { + switch(columnIndex) + { + case COLUMN_CHANNEL_NAME: + return stream.getChannel().getName(); + case COLUMN_CHANNEL_FORMAT: + return stream.getChannel().getSourceFormat().name(); + case COLUMN_SERVER_NAME: + return stream.getServer().getName(); + default: + break; + } + } + } + + return null; + } + + @Override + public String getColumnName(int column) + { + switch(column) + { + case COLUMN_CHANNEL_NAME: + return "Channel"; + case COLUMN_CHANNEL_FORMAT: + return "Format"; + case COLUMN_SERVER_NAME: + return "Server"; + } + + return null; + } +} diff --git a/src/audio/stream/shout/channel/IShoutChannel.java b/src/audio/stream/shout/channel/IShoutChannel.java new file mode 100644 index 00000000..08505a87 --- /dev/null +++ b/src/audio/stream/shout/channel/IShoutChannel.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * 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 + * + ******************************************************************************/ +package audio.stream.shout.channel; + +import audio.stream.shout.source.ShoutSourceFormat; + +public interface IShoutChannel +{ + public String getName(); + public ShoutSourceFormat getSourceFormat(); +} diff --git a/src/audio/stream/shout/channel/ShoutChannel.java b/src/audio/stream/shout/channel/ShoutChannel.java new file mode 100644 index 00000000..9b5901c3 --- /dev/null +++ b/src/audio/stream/shout/channel/ShoutChannel.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * 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 + * + ******************************************************************************/ +package audio.stream.shout.channel; + +import audio.stream.shout.source.IShoutSource; + +public class ShoutChannel +{ + private String mName; + private IShoutSource mShoutSource; + + public ShoutChannel(String name, IShoutSource shoutSource) + { + mName = name; + mShoutSource = shoutSource; + } + + public String getName() + { + return mName; + } +} diff --git a/src/audio/stream/shout/server/IShoutServer.java b/src/audio/stream/shout/server/IShoutServer.java new file mode 100644 index 00000000..f53c3697 --- /dev/null +++ b/src/audio/stream/shout/server/IShoutServer.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * 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 + * + ******************************************************************************/ +package audio.stream.shout.server; + +public interface IShoutServer +{ + public String getName(); +} diff --git a/src/audio/stream/shout/server/ShoutServer.java b/src/audio/stream/shout/server/ShoutServer.java new file mode 100644 index 00000000..1020a5c9 --- /dev/null +++ b/src/audio/stream/shout/server/ShoutServer.java @@ -0,0 +1,35 @@ +/******************************************************************************* + * 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 + * + ******************************************************************************/ +package audio.stream.shout.server; + +public abstract class ShoutServer implements IShoutServer +{ + private String mName; + + public ShoutServer(String name) + { + mName = name; + } + + @Override + public String getName() + { + return mName; + } +} diff --git a/src/audio/stream/shout/source/IShoutSource.java b/src/audio/stream/shout/source/IShoutSource.java new file mode 100644 index 00000000..198adeb4 --- /dev/null +++ b/src/audio/stream/shout/source/IShoutSource.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * 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 + * + ******************************************************************************/ +package audio.stream.shout.source; + +public interface IShoutSource +{ + public ShoutSourceFormat getFormat(); +} diff --git a/src/audio/stream/shout/source/MP3ShoutSource.java b/src/audio/stream/shout/source/MP3ShoutSource.java new file mode 100644 index 00000000..c5749a4f --- /dev/null +++ b/src/audio/stream/shout/source/MP3ShoutSource.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * 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 + * + ******************************************************************************/ +package audio.stream.shout.source; + +public class MP3ShoutSource extends ShoutSource +{ + public MP3ShoutSource() + { + super(ShoutSourceFormat.MP3); + } +} diff --git a/src/audio/stream/shout/source/ShoutSource.java b/src/audio/stream/shout/source/ShoutSource.java new file mode 100644 index 00000000..00d8184d --- /dev/null +++ b/src/audio/stream/shout/source/ShoutSource.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * 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 + * + ******************************************************************************/ +package audio.stream.shout.source; + +public abstract class ShoutSource implements IShoutSource +{ + private ShoutSourceFormat mFormat; + + public ShoutSource(ShoutSourceFormat format) + { + mFormat = format; + } + @Override + public ShoutSourceFormat getFormat() + { + return mFormat; + } +} diff --git a/src/audio/stream/shout/source/ShoutSourceFormat.java b/src/audio/stream/shout/source/ShoutSourceFormat.java new file mode 100644 index 00000000..bc447db8 --- /dev/null +++ b/src/audio/stream/shout/source/ShoutSourceFormat.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * 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 + * + ******************************************************************************/ +package audio.stream.shout.source; + +public enum ShoutSourceFormat +{ + MP3; +}