From 8d3597ccd40df79e35ad73184215fe7b8d942ba4 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Tue, 6 Sep 2005 20:52:21 +0000 Subject: [PATCH] Extension of callback interface to identify caller --- afeed.cc | 2 +- afeedr.cc | 2 +- callback.h | 2 +- player.h | 2 +- playerradio.cc | 4 ++-- playerradio.h | 2 +- playervideo.cc | 2 +- playervideo.h | 2 +- vfeed.cc | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/afeed.cc b/afeed.cc index 07480d0..8ff3f07 100644 --- a/afeed.cc +++ b/afeed.cc @@ -77,7 +77,7 @@ void AFeed::threadMethod() if (alen) { // Log::getInstance()->log("AFeed", Log::DEBUG, "Written %i", alen); - cb.call(); + cb.call(this); } else { diff --git a/afeedr.cc b/afeedr.cc index 1dd8a01..69385e6 100644 --- a/afeedr.cc +++ b/afeedr.cc @@ -62,7 +62,7 @@ void AFeedR::threadMethod() if (alen) { Log::getInstance()->log("AFeedR", Log::DEBUG, "Written %i", alen); - cb.call(); + cb.call(this); } else { diff --git a/callback.h b/callback.h index 3fbc2e0..01d5a23 100644 --- a/callback.h +++ b/callback.h @@ -24,7 +24,7 @@ class Callback { public: - virtual void call()=0; + virtual void call(void* caller)=0; }; #endif diff --git a/player.h b/player.h index 2a8ac2d..991d49c 100644 --- a/player.h +++ b/player.h @@ -49,7 +49,7 @@ class Player : public Thread, public Callback virtual void test2()=0; #endif - virtual void call()=0; // for callback interface + virtual void call(void*)=0; // for callback interface virtual void threadMethod()=0; // for thread interface virtual void threadPostStopCleanup()=0; diff --git a/playerradio.cc b/playerradio.cc index db0918e..03d291d 100644 --- a/playerradio.cc +++ b/playerradio.cc @@ -110,7 +110,7 @@ int PlayerRadio::play() audio->play(); - call(); + call(this); return 1; } @@ -296,7 +296,7 @@ void PlayerRadio::jumpToPercent(int percent) } -void PlayerRadio::call() +void PlayerRadio::call(void* caller) { Log::getInstance()->log("PlayerRadio", Log::DEBUG, "playerradio called\n"); // threadSignalNoLock(); diff --git a/playerradio.h b/playerradio.h index dab5d3e..f1fa756 100644 --- a/playerradio.h +++ b/playerradio.h @@ -49,7 +49,7 @@ class PlayerRadio : public Player void jumpToPercent(int percent); void skipForward(); void skipBackward(); - void call(); // for callback interface + void call(void*); // for callback interface void setPosition(ULLONG position); void setLength(ULLONG length); diff --git a/playervideo.cc b/playervideo.cc index 49a8276..8bba1bf 100644 --- a/playervideo.cc +++ b/playervideo.cc @@ -488,7 +488,7 @@ void PlayerVideo::jumpToPercent(int percent) } -void PlayerVideo::call() +void PlayerVideo::call(void* caller) { threadSignalNoLock(); } diff --git a/playervideo.h b/playervideo.h index 4b777e1..28963f9 100644 --- a/playervideo.h +++ b/playervideo.h @@ -53,7 +53,7 @@ class PlayerVideo : public Player void jumpToPercent(int percent); void skipForward(int seconds); void skipBackward(int seconds); - void call(); // for callback interface + void call(void*); // for callback interface void setPosition(ULLONG position); void setLength(ULLONG length); #ifdef DEV diff --git a/vfeed.cc b/vfeed.cc index 4f8001a..7ce9ad0 100644 --- a/vfeed.cc +++ b/vfeed.cc @@ -61,7 +61,7 @@ void VFeed::threadMethod() if (vlen) { // Log::getInstance()->log("VFeed", Log::DEBUG, "Written %i", vlen); - cb.call(); + cb.call(this); } else { -- 2.39.2