mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-11 08:07:24 -05:00
Implements a complex sample delay buffer integrated into the tuner
channel manager so that channel source requests can have a start timestamp specified and the channel can be preloaded with samples from the delay buffer. If no timestamp is specified, current time is assumed. This feature requires corresponding updates to any decoder that wishes to implement the timestamped sample preloading functionality.
This commit is contained in:
@@ -56,20 +56,28 @@ public class SourceEvent
|
||||
/**
|
||||
* Private constructor. Use the static constructor methods to create an event.
|
||||
*/
|
||||
private SourceEvent(Event event, Number value, String eventDescription)
|
||||
private SourceEvent(Event event, Source source, Number value, String eventDescription)
|
||||
{
|
||||
mEvent = event;
|
||||
mSource = source;
|
||||
mValue = value;
|
||||
mEventDescription = eventDescription;
|
||||
}
|
||||
|
||||
/**
|
||||
* Private constructor. Use the static constructor methods to create an event.
|
||||
*/
|
||||
private SourceEvent(Event event, Number value, String eventDescription)
|
||||
{
|
||||
this(event, null, value, eventDescription);
|
||||
}
|
||||
|
||||
/**
|
||||
* Private constructor. Use the static constructor methods to create an event.
|
||||
*/
|
||||
private SourceEvent(Event event, Number value)
|
||||
{
|
||||
mEvent = event;
|
||||
mValue = value;
|
||||
this(event, value, null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -77,8 +85,12 @@ public class SourceEvent
|
||||
*/
|
||||
private SourceEvent(Event event, Source source)
|
||||
{
|
||||
mEvent = event;
|
||||
mSource = source;
|
||||
this(event, source, 0);
|
||||
}
|
||||
|
||||
private SourceEvent(Event event, Source source, Number value)
|
||||
{
|
||||
this(event, source, value, null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -283,11 +295,22 @@ public class SourceEvent
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new start sample stream request event
|
||||
* Creates a new start sample stream request event. This method uses the current system time in
|
||||
* milliseconds as the requested sample start time.
|
||||
*/
|
||||
public static SourceEvent startSampleStreamRequest(Source source)
|
||||
{
|
||||
return new SourceEvent(Event.REQUEST_START_SAMPLE_STREAM, source);
|
||||
return startSampleStreamRequest(source, System.currentTimeMillis());
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new start sample stream request event and requests that samples (when available) for the
|
||||
* specified timestamp be pre-loaded into the source. The timestamp only applies for sources that incorporate
|
||||
* a sample delay buffer.
|
||||
*/
|
||||
public static SourceEvent startSampleStreamRequest(Source source, long timestamp)
|
||||
{
|
||||
return new SourceEvent(Event.REQUEST_START_SAMPLE_STREAM, source, timestamp);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -299,7 +322,7 @@ public class SourceEvent
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new stop sample stream request event
|
||||
* Creates a new stop sample stream notification event
|
||||
*/
|
||||
public static SourceEvent stopSampleStreamNotification(Source source)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user