Package adams.gui.tools.audioannotator
Class Ticker
- java.lang.Object
-
- adams.gui.tools.audioannotator.Ticker
-
public class Ticker extends Object
Provides tick events to listeners at various times- Author:
- sjb90
-
-
Field Summary
Fields Modifier and Type Field Description protected AudioPlaybackPanelm_AudioPlayerthe media player to get timestamps fromprotected List<ScheduledFuture<?>>m_HandlersA list of handlers for scheduled ticksprotected ScheduledExecutorServicem_SchedulerA scheduler to execute our commandprotected HashMap<Long,adams.gui.tools.audioannotator.Ticker.Tick>m_Ticksa set of the runnable's
-
Constructor Summary
Constructors Constructor Description Ticker(AudioPlaybackPanel player)Constructer for the ticker class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(TickListener tickListener)adds a listener to the tickervoidremoveAll()Shuts down all threads and removes them and the ticks from the ticker
-
-
-
Field Detail
-
m_Scheduler
protected ScheduledExecutorService m_Scheduler
A scheduler to execute our command
-
m_Handlers
protected List<ScheduledFuture<?>> m_Handlers
A list of handlers for scheduled ticks
-
m_Ticks
protected HashMap<Long,adams.gui.tools.audioannotator.Ticker.Tick> m_Ticks
a set of the runnable's
-
m_AudioPlayer
protected AudioPlaybackPanel m_AudioPlayer
the media player to get timestamps from
-
-
Constructor Detail
-
Ticker
public Ticker(AudioPlaybackPanel player)
Constructer for the ticker class.- Parameters:
player- the playback panel
-
-
Method Detail
-
addListener
public void addListener(TickListener tickListener)
adds a listener to the ticker- Parameters:
tickListener- the listener to add.
-
removeAll
public void removeAll()
Shuts down all threads and removes them and the ticks from the ticker
-
-