OBJECTS = main.o command.o log.o remote.o led.o mtd.o video.o audio.o tcp.o directory.o thread.o event.o \
player.o demuxer.o stream.o vfeed.o afeed.o afeedr.o osd.o surface.o viewman.o vdr.o dsock.o box.o \
- recording.o channel.o message.o playervideo.o playerradio.o messagequeue.o \
+ recording.o channel.o message.o playervideo.o messagequeue.o \
view.o vinfo.o vwallpaper.o vvolume.o vrecordinglist.o vlivebanner.o vmute.o \
- vrecordingmenu.o vquestion.o vchannellist.o vwelcome.o vvideolive.o vvideorec.o vradiolive.o \
+ vrecordingmenu.o vquestion.o vchannellist.o vwelcome.o vvideolive.o vvideorec.o \
vchannelselect.o vserverselect.o colour.o vconnect.o voptions.o vepg.o region.o \
widget.o wselectlist.o wjpeg.o wsymbol.o wbutton.o woptionbox.o wtextbox.o i18n.o timers.o \
fonts/helvB24.o fonts/helvB18.o
+# playerradio.o vradiolive.o
.PHONY: clean fresh all install strip
default: dev
fresh: clean default
-temp:
- $(CC) -E $(CXXFLAGS_DEV) -c i18n.cc
-
-
vompclient: $(OBJECTS)
$(CC) $(LDFLAGS) $(LIBPATHS) $(RELEASE) -o vompclient $(OBJECTS) $(CROSSLIBS) $(LIBS)
unMute();
+ // Set the volume variable to what the hardware is set at now
+ int hwvol = -1;
+ int hwvolFail = ioctl(fdAudio, AV_GET_AUD_VOLUME, &hwvol);
+ if (!hwvolFail)
+ {
+ volume = 20 - ((hwvol >> 16) & 0xFF);
+ if ((volume < 0) || (volume > 20)) volume = 20;
+ }
+
return 1;
}
{
firstBoot = 0;
+ logger->log("Command", Log::DEBUG, "Load power after boot");
+
config = vdr->configLoad("General", "Power After Boot");
if (config)
virtual void skipBackward(int seconds)=0;
virtual void setPosition(ULLONG position)=0;
virtual void setLength(ULLONG length)=0;
+ virtual void resyncAudio()=0;
#ifdef DEV
virtual void test1()=0;
virtual void test2()=0;
return 1;
}
+void PlayerVideo::resyncAudio()
+{
+ // Temp hopefully
+
+ if (!initted) return;
+
+ audio->pause();
+ usleep(500000); // SYNC
+ audio->unPause();
+}
+
int PlayerVideo::play()
{
if (!initted) return 0;
void call(void*); // for callback interface
void setPosition(ULLONG position);
void setLength(ULLONG length);
+ void resyncAudio();
#ifdef DEV
void test1();
void test2();
timeoutEnabled = 0;
}
+void TCP::getMAC(char* dest)
+{
+ struct ifreq ifr;
+ strcpy(ifr.ifr_name, "eth0");
+ ioctl(sock, SIOCGIFHWADDR, &ifr);
+ memcpy(dest, ifr.ifr_hwaddr.sa_data, 6);
+}
+
int TCP::connectTo(char* host, unsigned short port)
{
sock = socket(PF_INET, SOCK_STREAM, 0);
#include <arpa/inet.h>
#include <fcntl.h>
#include <ctype.h>
+#include <sys/ioctl.h>
+#include <net/if.h>
#include "defines.h"
#include "log.h"
static void dump(unsigned char* data, ULONG size);
+ void getMAC(char* dest); // copies 6 MAC bytes to dest
+
private:
int sock;
int connected;
{
if (!connected) return 0;
- UCHAR buffer[8];
+ UCHAR buffer[14];
- *(unsigned long*)&buffer[0] = htonl(4);
+ *(unsigned long*)&buffer[0] = htonl(10);
*(unsigned long*)&buffer[4] = htonl(VDR_LOGIN);
+ tcp->getMAC((char*)&buffer[8]);
+
+
pthread_mutex_lock(&mutex);
- int a = tcp->sendPacket(buffer, 8);
- if (a != 8)
+ int a = tcp->sendPacket(buffer, 14);
+ if (a != 14)
{
pthread_mutex_unlock(&mutex);
return 0;
if (!unavailable) player->play(); // do resync
return 2;
}
+ case Remote::PAUSE:
+ {
+ if (!unavailable) player->resyncAudio(); // do resync2
+ return 2;
+ }
case Remote::STOP:
case Remote::BACK: