from threading import Timer
from . import track

_listeners = []

class TrackChecker():
	def __init__(self, interval = 5):
		self.listeners = []
		self.CHECK_INTERVAL = interval
		self._generator = self._checkSongGenerator()
		self.timer = None

	def _checkSongGenerator(self):
		while True:
			currentSong = ""
			currentArtist = ""
			currentAlbum = ""
			song = track.getCurrentSong()
			artist = track.getCurrentArtist()
			album = track.getCurrentAlbum()

			if (song != currentSong or artist != currentArtist 
				or album != currentAlbum):
				currentSong = song
				currentArtist = artist
				currentAlbum = album
				self._callListeners()
			yield

	def checkSong(self):
		next(self._generator)
		if self.timer != None:
			self.startTimer()

	def registerListener(self, function):
		_listeners.append(function)

	def _callListeners(self):
		for listener in _listeners:
			listener()

	def startTimer(self):
		self.timer = Timer(self.CHECK_INTERVAL, self.checkSong)
		self.timer.start()

	def cancelTimer(self):
		self.timer.cancel()

@@ -182,47 +182,75 @@
 elf.
-_generator = self._checkSongGenerator()
+currentSong = %22%22%0A%09%09self.currentArtist = %22%22%0A%09%09self.currentAlbum = %22%22
 %0A%09%09s
@@ -272,17 +272,16 @@
 e%0A%0A%09def 
-_
 checkSon
@@ -285,25 +285,16 @@
 Song
-Generator
 (self):%0A
 %09%09wh
@@ -293,86 +293,8 @@
 f):%0A
-%09%09while True:%0A%09%09%09currentSong = %22%22%0A%09%09%09currentArtist = %22%22%0A%09%09%09currentAlbum = %22%22%0A%09
 %09%09so
@@ -321,17 +321,16 @@
 tSong()%0A
-%09
 %09%09artist
@@ -357,17 +357,16 @@
 rtist()%0A
-%09
 %09%09album 
@@ -394,17 +394,16 @@
 um()%0A%0A%09%09
-%09
 if (song
@@ -402,24 +402,29 @@
 if (song != 
+self.
 currentSong 
@@ -432,24 +432,29 @@
 r artist != 
+self.
 currentArtis
@@ -456,17 +456,16 @@
 Artist %0A
-%09
 %09%09%09or al
@@ -471,16 +471,21 @@
 lbum != 
+self.
 currentA
@@ -490,25 +490,29 @@
 tAlbum):%0A%09%09%09
-%09
+self.
 currentSong 
@@ -517,25 +517,29 @@
 g = song%0A%09%09%09
-%09
+self.
 currentArtis
@@ -552,17 +552,21 @@
 tist%0A%09%09%09
-%09
+self.
 currentA
@@ -581,17 +581,16 @@
 lbum%0A%09%09%09
-%09
 self._ca
@@ -609,61 +609,8 @@
 )%0A%09%09
-%09yield%0A%0A%09def checkSong(self):%0A%09%09next(self._generator)
 %0A%09%09i
@@ -944,8 +944,28 @@
 ancel()%0A
+%09%09self.timer = None%0A

Remove use of generator completely