mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
#30 WIP - icecast 2 broadcaster cleanup
This commit is contained in:
@@ -242,26 +242,18 @@ public class BroadcastModel extends AbstractTableModel implements Listener<Audio
|
||||
|
||||
public void removeBroadcastConfiguration(BroadcastConfiguration broadcastConfiguration)
|
||||
{
|
||||
mLog.debug("Removing broadcast configuration: " + broadcastConfiguration.getName());
|
||||
if(broadcastConfiguration != null && mBroadcastConfigurations.contains(broadcastConfiguration))
|
||||
{
|
||||
int index = mBroadcastConfigurations.indexOf(broadcastConfiguration);
|
||||
|
||||
mLog.debug("Removing configuration. Index was:" + index);
|
||||
mBroadcastConfigurations.remove(broadcastConfiguration);
|
||||
|
||||
mLog.debug("Removing configuration from map. Index was:" + index);
|
||||
mBroadcastConfigurationMap.remove(broadcastConfiguration.getName());
|
||||
|
||||
mLog.debug("Broadcasting config delete event");
|
||||
process(new BroadcastEvent( broadcastConfiguration, BroadcastEvent.Event.CONFIGURATION_DELETE));
|
||||
|
||||
fireTableRowsDeleted( index, index );
|
||||
}
|
||||
else
|
||||
{
|
||||
mLog.debug("Config was null or not in the broadcaast configs list");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -339,12 +331,10 @@ public class BroadcastModel extends AbstractTableModel implements Listener<Audio
|
||||
*/
|
||||
private void deleteBroadcaster(String name)
|
||||
{
|
||||
mLog.debug("Deleting broadcaster: " + name);
|
||||
if(name != null && mBroadcasterMap.containsKey(name))
|
||||
{
|
||||
AudioBroadcaster audioBroadcaster = mBroadcasterMap.remove(name);
|
||||
|
||||
mLog.debug("Found the broadcaster: " + (audioBroadcaster != null));
|
||||
if(audioBroadcaster != null)
|
||||
{
|
||||
audioBroadcaster.stop();
|
||||
@@ -360,9 +350,12 @@ public class BroadcastModel extends AbstractTableModel implements Listener<Audio
|
||||
broadcast(new BroadcastEvent(audioBroadcaster, BroadcastEvent.Event.BROADCASTER_DELETE));
|
||||
}
|
||||
}
|
||||
mLog.debug("Finished deleting broadcaster: " + name);
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP client shared across all broadcaster instances. Note: client is lazy construct so that it isn't
|
||||
* created until required
|
||||
*/
|
||||
private DefaultAsyncHttpClient getDefaultAsyncHttpClient()
|
||||
{
|
||||
if (mDefaultAsyncHttpClient == null)
|
||||
|
||||
Reference in New Issue
Block a user