diff options
| author | Bent Bisballe Nyeng <deva@aasimon.org> | 2014-06-04 10:46:41 +0200 | 
|---|---|---|
| committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2014-06-04 10:46:41 +0200 | 
| commit | 7a290431cf56a54886888d90c9b0aea65a7940de (patch) | |
| tree | 80c5ee81f0e671a9f7f6390c6e8065dc505af60d /src | |
| parent | 9fa8ce5d62a24efa4e5b584f5a6cf921e3052be8 (diff) | |
Move all pixmaps into qrc.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile.am | 14 | ||||
| -rw-r--r-- | src/decoder.cc | 4 | ||||
| -rw-r--r-- | src/dvfile.cc | 14 | ||||
| -rw-r--r-- | src/dvfile.h | 4 | ||||
| -rw-r--r-- | src/miav.qrc | 23 | 
5 files changed, 44 insertions, 15 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index ac0545c..91ca228 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -12,11 +12,11 @@ endif  AM_CXXFLAGS = $(QT_CFLAGS)  miav_CXXFLAGS = $(SDL_CFLAGS) $(DV_CFLAGS) $(IEC61883_CFLAGS) $(QT_CFLAGS) \ -	-I../include -DPIXMAPS=\"$(datadir)/pixmaps\" \ -	-DETC=\"$(prefix)/etc/miav\" -I$(top_srcdir)/hugin +	-I../include -DETC=\"$(prefix)/etc/miav\" -I$(top_srcdir)/hugin \ +	-DPIXMAPS=\":/pixmaps\"  miav_LDADD = $(shell ../tools/MocList o) $(QT_LIBS) $(IEC61883_LIBS) \ -	$(SDL_LIBS) $(DV_LIBS) +	$(SDL_LIBS) $(DV_LIBS) qrc_miav.o   miav_SOURCES = \  	aa_socket.cc \ @@ -141,14 +141,18 @@ EXTRA_DIST = \  	threadsafe_queue_priority.h \  	util.h \  	videowidget.h \ -	yuv_draw.h +	yuv_draw.h \ +	miav.qrc  miav_MOC = $(shell  if [ $QT_CXXFLAGS ] ; then ../tools/MocList cc; fi ) -BUILT_SOURCES = $(miav_MOC) +BUILT_SOURCES = $(miav_MOC) qrc_miav.cc  CLEANFILES = $(BUILT_SOURCES) +qrc_%.cc: %.qrc +	rcc $< > $@ +  %.moc.cc: %.h  	$(QT_MOC) -o $@ $< diff --git a/src/decoder.cc b/src/decoder.cc index f32c18a..9e34a28 100644 --- a/src/decoder.cc +++ b/src/decoder.cc @@ -92,8 +92,8 @@ void Decoder::decode()    bool skip_frames = config->readInt("player_skip_frames"); -  dv1394 dv1394_stream = dv1394(info); // Use default port and channel. -  dvfile dvfile_stream = dvfile(info); +  dv1394 dv1394_stream(info); // Use default port and channel. +  dvfile dvfile_stream(info);    if(dv1394_stream.connect()) {       // Use the dv1394 stream for input.      dvstream = &dv1394_stream; diff --git a/src/dvfile.cc b/src/dvfile.cc index b942e42..b7c7f47 100644 --- a/src/dvfile.cc +++ b/src/dvfile.cc @@ -32,15 +32,17 @@  #include "util.h"  dvfile::dvfile(Info* i) +  : fp(QString(TEST_MOVIE))  {    info = i; -  fp = fopen(TEST_MOVIE, "r"); -  if(!fp) info->error("Couldn't open %s for reading.", TEST_MOVIE); +  if(!fp.open(QIODevice::ReadOnly)) { +    info->error("Couldn't open %s for reading.", TEST_MOVIE); +  }  }  dvfile::~dvfile()  { -  fclose(fp); +  fp.close();  }  unsigned char *dvfile::readFrame() @@ -49,9 +51,9 @@ unsigned char *dvfile::readFrame()    sleep_1_frame(); -  if(fp) { -    while(fread(frame, DVPACKAGE_SIZE, 1, fp) == 0) { -      fseek(fp, 0L, SEEK_SET); +  if(fp.isReadable()) { +    while(fp.read((char *)frame, DVPACKAGE_SIZE) == 0) { +      fp.seek(0);      }    } else {      memset(frame, 0, sizeof(frame)); diff --git a/src/dvfile.h b/src/dvfile.h index 1052c55..b78ec68 100644 --- a/src/dvfile.h +++ b/src/dvfile.h @@ -29,7 +29,7 @@  #include "frame_stream.h" -#include <stdio.h> +#include <QFile>  #include "info.h" @@ -44,7 +44,7 @@ public:  private:    Info* info; -  FILE* fp; +  QFile fp;  };  #endif/*__MIAV_DVFILE_H__*/ diff --git a/src/miav.qrc b/src/miav.qrc new file mode 100644 index 0000000..76d4442 --- /dev/null +++ b/src/miav.qrc @@ -0,0 +1,23 @@ +<!DOCTYPE RCC> +<RCC version="1.0"> +<qresource> +    <file alias="pixmaps/mute.png">../pixmaps/mute.png</file> +    <file alias="pixmaps/unmute.png">../pixmaps/unmute.png</file> +    <file alias="pixmaps/record.png">../pixmaps/record.png</file> +    <file alias="pixmaps/stop.png">../pixmaps/stop.png</file> +    <file alias="pixmaps/freeze.png">../pixmaps/freeze.png</file> +    <file alias="pixmaps/unfreeze.png">../pixmaps/unfreeze.png</file> +    <file alias="pixmaps/cpr.png">../pixmaps/cpr.png</file> +    <file alias="pixmaps/clear.png">../pixmaps/clear.png</file> +    <file alias="pixmaps/snapshot.png">../pixmaps/snapshot.png</file> +    <file alias="pixmaps/dummy.png">../pixmaps/dummy.png</file> +    <file alias="pixmaps/miav-logo.png">../pixmaps/miav-logo.png</file> + +    <file alias="pixmaps/dummy.dv">../pixmaps/dummy.dv</file> + +    <file alias="pixmaps/info.png">../pixmaps/info.png</file> +    <file alias="pixmaps/warning.png">../pixmaps/warning.png</file> +    <file alias="pixmaps/question.png">../pixmaps/question.png</file> +    <file alias="pixmaps/error.png">../pixmaps/error.png</file> +</qresource> +</RCC>  | 
