From 7a290431cf56a54886888d90c9b0aea65a7940de Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Wed, 4 Jun 2014 10:46:41 +0200 Subject: Move all pixmaps into qrc. --- src/Makefile.am | 14 +++++++++----- src/decoder.cc | 4 ++-- src/dvfile.cc | 14 ++++++++------ src/dvfile.h | 4 ++-- src/miav.qrc | 23 +++++++++++++++++++++++ 5 files changed, 44 insertions(+), 15 deletions(-) create mode 100644 src/miav.qrc (limited to 'src') 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 +#include #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 @@ + + + + ../pixmaps/mute.png + ../pixmaps/unmute.png + ../pixmaps/record.png + ../pixmaps/stop.png + ../pixmaps/freeze.png + ../pixmaps/unfreeze.png + ../pixmaps/cpr.png + ../pixmaps/clear.png + ../pixmaps/snapshot.png + ../pixmaps/dummy.png + ../pixmaps/miav-logo.png + + ../pixmaps/dummy.dv + + ../pixmaps/info.png + ../pixmaps/warning.png + ../pixmaps/question.png + ../pixmaps/error.png + + -- cgit v1.2.3