mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -05:00
Updates playlist editor with Add, Copy/Clone and Delete channel
functionality
This commit is contained in:
@@ -50,4 +50,39 @@ public class SourceConfigFactory
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a copy of the configuration
|
||||
*/
|
||||
public static SourceConfiguration copy( SourceConfiguration config )
|
||||
{
|
||||
if( config != null )
|
||||
{
|
||||
switch( config.getSourceType() )
|
||||
{
|
||||
case MIXER:
|
||||
SourceConfigMixer originalMixer = (SourceConfigMixer)config;
|
||||
SourceConfigMixer copyMixer = new SourceConfigMixer();
|
||||
copyMixer.setChannel( originalMixer.getChannel() );
|
||||
copyMixer.setMixer( originalMixer.getMixer() );
|
||||
return copyMixer;
|
||||
case RECORDING:
|
||||
SourceConfigRecording originalRec = (SourceConfigRecording)config;
|
||||
SourceConfigRecording copyRec = new SourceConfigRecording();
|
||||
copyRec.setFrequency( originalRec.getFrequency() );
|
||||
copyRec.setRecordingAlias( originalRec.getRecordingAlias() );
|
||||
return copyRec;
|
||||
case TUNER:
|
||||
SourceConfigTuner originalTuner = (SourceConfigTuner)config;
|
||||
SourceConfigTuner copyTuner = new SourceConfigTuner();
|
||||
copyTuner.setFrequency( originalTuner.getFrequency() );
|
||||
return copyTuner;
|
||||
case NONE:
|
||||
default:
|
||||
return new SourceConfigNone();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user