Adds a new JMBE Audio Library preference to the user preferences editor (#489)

so that users can set the library path once and it will persist across
application upgrades so that they do NOT have to copy the library to
their application install with each upgrade.
This commit is contained in:
Denny Sheirer
2019-01-19 10:19:18 +00:00
committed by GitHub
parent e51f485a2e
commit 1e37a63d34
9 changed files with 444 additions and 60 deletions

View File

@@ -21,6 +21,7 @@
package io.github.dsheirer.preference;
import io.github.dsheirer.eventbus.MyEventBus;
import io.github.dsheirer.preference.decoder.JmbeLibraryPreference;
import io.github.dsheirer.preference.directory.DirectoryPreference;
import io.github.dsheirer.preference.event.DecodeEventPreference;
import io.github.dsheirer.preference.identifier.TalkgroupFormatPreference;
@@ -47,6 +48,7 @@ import io.github.dsheirer.sample.Listener;
*/
public class UserPreferences implements Listener<PreferenceType>
{
private JmbeLibraryPreference mJmbeLibraryPreference;
private DecodeEventPreference mDecodeEventPreference;
private DirectoryPreference mDirectoryPreference;
private ChannelMultiFrequencyPreference mChannelMultiFrequencyPreference;
@@ -70,6 +72,14 @@ public class UserPreferences implements Listener<PreferenceType>
return mDecodeEventPreference;
}
/**
* Decoder preferences
*/
public JmbeLibraryPreference getJmbeLibraryPreference()
{
return mJmbeLibraryPreference;
}
/**
* Directory preferences
*/
@@ -115,12 +125,13 @@ public class UserPreferences implements Listener<PreferenceType>
*/
private void loadPreferenceTypes()
{
mDecodeEventPreference = new DecodeEventPreference(this);
mDirectoryPreference = new DirectoryPreference(this);
mChannelMultiFrequencyPreference = new ChannelMultiFrequencyPreference(this);
mPlaylistPreference = new PlaylistPreference(this, mDirectoryPreference);
mTalkgroupFormatPreference = new TalkgroupFormatPreference(this);
mTunerPreference = new TunerPreference(this);
mDecodeEventPreference = new DecodeEventPreference(this::receive);
mJmbeLibraryPreference = new JmbeLibraryPreference(this::receive);
mDirectoryPreference = new DirectoryPreference(this::receive);
mChannelMultiFrequencyPreference = new ChannelMultiFrequencyPreference(this::receive);
mPlaylistPreference = new PlaylistPreference(this::receive, mDirectoryPreference);
mTalkgroupFormatPreference = new TalkgroupFormatPreference(this::receive);
mTunerPreference = new TunerPreference(this::receive);
}
/**