From e3df63655e0e1f578f3e7e85e51bfff2c0300334 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Tue, 3 Mar 2020 21:50:23 +0000 Subject: [PATCH] Rename class: PlayerLiveRadio to PlayerRadioLive --- objects.mk | 4 +- playerliveradio.cc => playerradiolive.cc | 94 ++++++++++++------------ playerliveradio.h => playerradiolive.h | 10 +-- vvideolivetv.cc | 4 +- 4 files changed, 56 insertions(+), 56 deletions(-) rename playerliveradio.cc => playerradiolive.cc (79%) rename playerliveradio.h => playerradiolive.h (93%) diff --git a/objects.mk b/objects.mk index dd220df..5fa2805 100644 --- a/objects.mk +++ b/objects.mk @@ -14,12 +14,12 @@ OBJ_COMMON = command.o tcp.o dsock.o thread.o timers.o i18n.o vdp6.o woptionpane.o woptionbox.o wremoteconfig.o wtabbar.o led.o \ inputman.o input.o inputudp.o vpicturebanner.o abstractoption.o \ eventdispatcher.o vdrrequestpacket.o vdrresponsepacket.o \ - vvideolivetv.o vsleeptimer.o playerliveradio.o \ + vvideolivetv.o vsleeptimer.o \ wprogressbar.o bitmap.o dvbsubtitles.o tfeed.o vteletextview.o \ teletextdecodervbiebu.o teletxt/txtfont.o movieinfo.o seriesinfo.o \ wmovieview.o wseriesview.o tvmedia.o wtvmedia.o wpictureview.o \ osdvector.o surfacevector.o buffer.o \ - playervideorec.o playervideolive.o + playervideorec.o playervideolive.o playerradiolive.o OBJ_RASPBERRY = main.o threadp.o osdopenvg.o \ ledraspberry.o videoomx.o audioomx.o imageomx.o \ diff --git a/playerliveradio.cc b/playerradiolive.cc similarity index 79% rename from playerliveradio.cc rename to playerradiolive.cc index 648dab8..8caaa2e 100644 --- a/playerliveradio.cc +++ b/playerradiolive.cc @@ -17,7 +17,7 @@ along with VOMP. If not, see . */ -#include "playerliveradio.h" +#include "playerradiolive.h" #include "defines.h" #include "log.h" @@ -32,7 +32,7 @@ // ----------------------------------- Called from outside, one offs or info funcs -PlayerLiveRadio::PlayerLiveRadio(MessageQueue* tmessageQueue, void* tmessageReceiver, ChannelList* tchanList) +PlayerRadioLive::PlayerRadioLive(MessageQueue* tmessageQueue, void* tmessageReceiver, ChannelList* tchanList) : afeed(this) { messageQueue = tmessageQueue; @@ -49,12 +49,12 @@ PlayerLiveRadio::PlayerLiveRadio(MessageQueue* tmessageQueue, void* tmessageRece Video::getInstance()->turnVideoOff(); } -PlayerLiveRadio::~PlayerLiveRadio() +PlayerRadioLive::~PlayerRadioLive() { if (initted) shutdown(); } -int PlayerLiveRadio::init() +int PlayerRadioLive::init() { if (initted) return 0; @@ -63,7 +63,7 @@ int PlayerLiveRadio::init() if (!demuxer->init(this, audio, NULL, NULL, 0, 200000, 0)) { - logger->log("PlayerLiveRadio", Log::ERR, "Demuxer failed to init"); + logger->log("PlayerRadioLive", Log::ERR, "Demuxer failed to init"); shutdown(); return 0; } @@ -74,7 +74,7 @@ int PlayerLiveRadio::init() return 1; } -int PlayerLiveRadio::shutdown() +int PlayerRadioLive::shutdown() { if (!initted) return 0; stop(); @@ -83,44 +83,44 @@ int PlayerLiveRadio::shutdown() return 1; } -bool* PlayerLiveRadio::getDemuxerMpegAudioChannels() +bool* PlayerRadioLive::getDemuxerMpegAudioChannels() { return demuxer->getmpAudioChannels(); } -bool* PlayerLiveRadio::getDemuxerAc3AudioChannels() +bool* PlayerRadioLive::getDemuxerAc3AudioChannels() { return demuxer->getac3AudioChannels(); } -int PlayerLiveRadio::getCurrentAudioChannel() +int PlayerRadioLive::getCurrentAudioChannel() { return demuxer->getAID(); } -int* PlayerLiveRadio::getTeletxtSubtitlePages() +int* PlayerRadioLive::getTeletxtSubtitlePages() { return NULL; } -int PlayerLiveRadio::getCurrentSubtitleChannel() +int PlayerRadioLive::getCurrentSubtitleChannel() { return demuxer->getSubID(); } -void PlayerLiveRadio::setAudioChannel(int newChannel, int type, int streamtype) +void PlayerRadioLive::setAudioChannel(int newChannel, int type, int streamtype) { demuxer->setAID(newChannel, type, streamtype, true); } -void PlayerLiveRadio::setSubtitleChannel(int newChannel) +void PlayerRadioLive::setSubtitleChannel(int newChannel) { demuxer->setSubID(newChannel); } // ----------------------------------- Externally called events -void PlayerLiveRadio::go(ULONG index) +void PlayerRadioLive::go(ULONG index) { struct PLInstruction i; i.instruction = I_SETCHANNEL; @@ -129,20 +129,20 @@ void PlayerLiveRadio::go(ULONG index) threadStart(); } -void PlayerLiveRadio::setChannel(ULONG index) +void PlayerRadioLive::setChannel(ULONG index) { - logger->log("PlayerLiveRadio", Log::DEBUG, "setChannel"); + logger->log("PlayerRadioLive", Log::DEBUG, "setChannel"); struct PLInstruction i; i.instruction = I_SETCHANNEL; i.channelIndex = index; instructions.push(i); - logger->log("PlayerLiveRadio", Log::DEBUG, "posted setChannel instruction, now %i in queue", instructions.size()); + logger->log("PlayerRadioLive", Log::DEBUG, "posted setChannel instruction, now %i in queue", instructions.size()); threadSignalNoLock(); } -void PlayerLiveRadio::stop() +void PlayerRadioLive::stop() { - logger->log("PlayerLiveRadio", Log::DEBUG, "stop"); + logger->log("PlayerRadioLive", Log::DEBUG, "stop"); struct PLInstruction i; i.instruction = I_STOP; instructions.push(i); @@ -152,13 +152,13 @@ void PlayerLiveRadio::stop() // ----------------------------------- Callback -void PlayerLiveRadio::call(void* /*caller*/) +void PlayerRadioLive::call(void* /*caller*/) { } // ----------------------------------- -void PlayerLiveRadio::streamReceive(ULONG flag, void* data, ULONG len) +void PlayerRadioLive::streamReceive(ULONG flag, void* data, ULONG len) { // Flag: // 0 = normal stream packet @@ -173,7 +173,7 @@ void PlayerLiveRadio::streamReceive(ULONG flag, void* data, ULONG len) m->from = this; m->to = messageReceiver; m->message = Message::PLAYER_EVENT; - m->parameter = PlayerLiveRadio::STREAM_END; + m->parameter = PlayerRadioLive::STREAM_END; messageQueue->postMessage(m); } @@ -189,34 +189,34 @@ void PlayerLiveRadio::streamReceive(ULONG flag, void* data, ULONG len) { // Too many chunks in streamChunks, drop this chunk free(data); - logger->log("PlayerLiveRadio", Log::WARN, "Dropped chunk"); + logger->log("PlayerRadioLive", Log::WARN, "Dropped chunk"); } } -void PlayerLiveRadio::clearStreamChunks() +void PlayerRadioLive::clearStreamChunks() { while(streamChunks.size()) { - logger->log("PlayerLiveRadio", Log::DEBUG, "Dropping chunk from old stream"); + logger->log("PlayerRadioLive", Log::DEBUG, "Dropping chunk from old stream"); struct StreamChunk s = streamChunks.front(); streamChunks.pop(); free(s.data); } } -void PlayerLiveRadio::chunkToDemuxer() +void PlayerRadioLive::chunkToDemuxer() { StreamChunk s = streamChunks.front(); streamChunks.pop(); - //logger->log("PlayerLiveRadio", Log::DEBUG, "About to call demuxer with %p %lu", s.data, s.len); + //logger->log("PlayerRadioLive", Log::DEBUG, "About to call demuxer with %p %lu", s.data, s.len); /*int a =*/ demuxer->put((UCHAR*)s.data, s.len); - //logger->log("PlayerLiveRadio", Log::DEBUG, "put %i to demuxer", a); + //logger->log("PlayerRadioLive", Log::DEBUG, "put %i to demuxer", a); free(s.data); } -void PlayerLiveRadio::switchState(UCHAR newState) +void PlayerRadioLive::switchState(UCHAR newState) { - logger->log("PlayerLiveRadio", Log::DEBUG, "Switch from state %u to state %u", state, newState); + logger->log("PlayerRadioLive", Log::DEBUG, "Switch from state %u to state %u", state, newState); switch(state) { @@ -243,7 +243,7 @@ void PlayerLiveRadio::switchState(UCHAR newState) } default: { - logger->log("PlayerLiveRadio", Log::EMERG, "Thread called state %u to state %u which is not supported", state, newState); + logger->log("PlayerRadioLive", Log::EMERG, "Thread called state %u to state %u which is not supported", state, newState); abort(); break; } @@ -288,7 +288,7 @@ void PlayerLiveRadio::switchState(UCHAR newState) } default: { - logger->log("PlayerLiveRadio", Log::EMERG, "Thread called state %u to state %u which is not supported", state, newState); + logger->log("PlayerRadioLive", Log::EMERG, "Thread called state %u to state %u which is not supported", state, newState); abort(); break; } @@ -327,7 +327,7 @@ void PlayerLiveRadio::switchState(UCHAR newState) } default: { - logger->log("PlayerLiveRadio", Log::EMERG, "Thread called state %u to state %u which is not supported", state, newState); + logger->log("PlayerRadioLive", Log::EMERG, "Thread called state %u to state %u which is not supported", state, newState); abort(); break; } @@ -336,7 +336,7 @@ void PlayerLiveRadio::switchState(UCHAR newState) } } -bool PlayerLiveRadio::checkError() +bool PlayerRadioLive::checkError() { if (!vdr->isConnected()) { @@ -346,7 +346,7 @@ bool PlayerLiveRadio::checkError() m->from = this; m->to = messageReceiver; m->message = Message::PLAYER_EVENT; - m->parameter = PlayerLiveRadio::CONNECTION_LOST; + m->parameter = PlayerRadioLive::CONNECTION_LOST; messageQueue->postMessage(m); return true; @@ -354,7 +354,7 @@ bool PlayerLiveRadio::checkError() return false; } -void PlayerLiveRadio::optimizeInstructionQueue() +void PlayerRadioLive::optimizeInstructionQueue() { // Walk the list @@ -375,7 +375,7 @@ void PlayerLiveRadio::optimizeInstructionQueue() } } -void PlayerLiveRadio::threadMethod() +void PlayerRadioLive::threadMethod() { while(1) { @@ -383,7 +383,7 @@ void PlayerLiveRadio::threadMethod() { if (instructions.size() > 1) { - logger->log("PlayerLiveRadio", Log::DEBUG, "Should optimise"); + logger->log("PlayerRadioLive", Log::DEBUG, "Should optimise"); optimizeInstructionQueue(); } @@ -392,7 +392,7 @@ void PlayerLiveRadio::threadMethod() if (i.instruction == I_SETCHANNEL) { - logger->log("PlayerLiveRadio", Log::DEBUG, "start new stream"); + logger->log("PlayerRadioLive", Log::DEBUG, "start new stream"); switchState(S_PREBUFFERING); @@ -412,7 +412,7 @@ void PlayerLiveRadio::threadMethod() { demuxer->setAID(chan->apids[j].pid, 0, chan->apids[j].type, true); audio->setStreamType(Audio::MPEG2_PES); - logger->log("PlayerLiveRadio", Log::DEBUG, "Demuxer pids: %u %u %u", chan->vpid, chan->apids[j].pid, chan->apids[j].type); + logger->log("PlayerRadioLive", Log::DEBUG, "Demuxer pids: %u %u %u", chan->vpid, chan->apids[j].pid, chan->apids[j].type); found = true; } j++; @@ -430,7 +430,7 @@ void PlayerLiveRadio::threadMethod() { demuxer->setAID(chan->dpids[j].pid, 1, chan->dpids[j].type, true); audio->setStreamType(Audio::MPEG2_PES); - logger->log("PlayerLiveRadio", Log::DEBUG, "Demuxer pids: %u %u (ac3) %u", chan->vpid, chan->dpids[j].pid, chan->dpids[j].type); + logger->log("PlayerRadioLive", Log::DEBUG, "Demuxer pids: %u %u (ac3) %u", chan->vpid, chan->dpids[j].pid, chan->dpids[j].type); found=true; } j++; @@ -438,7 +438,7 @@ void PlayerLiveRadio::threadMethod() } else { - logger->log("PlayerLiveRadio", Log::WARN, "Demuxer no pids!"); + logger->log("PlayerRadioLive", Log::WARN, "Demuxer no pids!"); } } @@ -449,14 +449,14 @@ void PlayerLiveRadio::threadMethod() m->from = this; m->to = messageReceiver; m->message = Message::PLAYER_EVENT; - m->parameter = PlayerLiveRadio::STREAM_END; + m->parameter = PlayerRadioLive::STREAM_END; messageQueue->postMessage(m); } } } else if (i.instruction == I_STOP) { - logger->log("PlayerLiveRadio", Log::DEBUG, "Stopping"); + logger->log("PlayerRadioLive", Log::DEBUG, "Stopping"); switchState(S_STOP); checkError(); @@ -475,13 +475,13 @@ void PlayerLiveRadio::threadMethod() { ++preBufferCount; ULONG percentDone = (ULONG)(preBufferCount / (float)preBufferAmount * 100); - logger->log("PlayerLiveRadio", Log::DEBUG, "Prebuffering %lu%%", percentDone); + logger->log("PlayerRadioLive", Log::DEBUG, "Prebuffering %lu%%", percentDone); Message* m = new Message(); m->from = this; m->to = messageReceiver; m->message = Message::PLAYER_EVENT; - m->parameter = PlayerLiveRadio::PREBUFFERING; + m->parameter = PlayerRadioLive::PREBUFFERING; m->tag = percentDone; messageQueue->postMessage(m); @@ -498,5 +498,5 @@ void PlayerLiveRadio::threadMethod() threadUnlock(); } - logger->log("PlayerLiveRadio", Log::DEBUG, "End of thread"); + logger->log("PlayerRadioLive", Log::DEBUG, "End of thread"); } diff --git a/playerliveradio.h b/playerradiolive.h similarity index 93% rename from playerliveradio.h rename to playerradiolive.h index 2b7f67c..6ee6e02 100644 --- a/playerliveradio.h +++ b/playerradiolive.h @@ -17,8 +17,8 @@ along with VOMP. If not, see . */ -#ifndef PLAYERLIVERADIO_H -#define PLAYERLIVERADIO_H +#ifndef PLAYERRADIOLIVE_H +#define PLAYERRADIOLIVE_H #include #include @@ -47,11 +47,11 @@ class Audio; class Log; class DemuxerTS; -class PlayerLiveRadio : public PlayerLive, public Thread_TYPE, public Callback, public StreamReceiver +class PlayerRadioLive : public PlayerLive, public Thread_TYPE, public Callback, public StreamReceiver { public: - PlayerLiveRadio(MessageQueue* messageQueue, void* messageReceiver, ChannelList* chanList); - virtual ~PlayerLiveRadio(); + PlayerRadioLive(MessageQueue* messageQueue, void* messageReceiver, ChannelList* chanList); + virtual ~PlayerRadioLive(); virtual int init(); virtual int shutdown(); diff --git a/vvideolivetv.cc b/vvideolivetv.cc index 2c9178e..a332417 100644 --- a/vvideolivetv.cc +++ b/vvideolivetv.cc @@ -24,7 +24,7 @@ #include "audio.h" #include "playerlive.h" #include "playervideolive.h" -#include "playerliveradio.h" +#include "playerradiolive.h" #include "channel.h" #include "boxstack.h" #include "colour.h" @@ -94,7 +94,7 @@ VVideoLiveTV::VVideoLiveTV(ChannelList* tchanList, ULONG initialChannelNumber, V else { streamType = VDR::RADIO; - player = new PlayerLiveRadio(Command::getInstance(), this, chanList); + player = new PlayerRadioLive(Command::getInstance(), this, chanList); } player->init(); -- 2.39.5