Browse files

feedback & overlay fix

  • Loading branch information...
1 parent 848b07b commit 70de4ed05c01d12218c196b84c9527245809bb5a Michael Demetriou committed Oct 1, 2012
Showing with 84 additions and 7 deletions.
  1. +4 −0 CameraThread.cpp
  2. +6 −5 CameraThread.h
  3. +14 −0 feedback.cpp
  4. +29 −0 feedback.h
  5. BIN halftoneBlack.png
  6. +6 −0 qtc_packaging/debian_harmattan/changelog
  7. +15 −0 rawcam.cpp
  8. +5 −2 rawcam.pro
  9. +5 −0 style.css
View
4 CameraThread.cpp
@@ -14,6 +14,7 @@
#include "OverlayWidget.h"
#include "CameraParameters.h"
+#include "feedback.h"
//#include "LEDBlinker.h"
//SDK doesn't have these defines
@@ -119,6 +120,9 @@ void CameraThread::run() {
photo.gain = viewfinder.gain;
photo.whiteBalance = viewfinder.whiteBalance;
if (parameters->flash.mode != CameraParameters::Flash::OFF) photo.addAction(fire);
+ else photo.clearActions();
+ feedback.time = photo.exposure;
+ photo.addAction(feedback);
sensor.capture(photo);
takeSnapshot = false;
View
11 CameraThread.h
@@ -10,6 +10,7 @@
#include "CameraParameters.h"
#include <QString>
#include <QSettings>
+#include "feedback.h"
class OverlayWidget;
@@ -18,15 +19,15 @@ class CameraThread : public QThread {
public:
CameraParameters* parameters;
+ feedBack feedback;
FCam::AsyncFileWriter writer;
CameraThread(OverlayWidget *o, QObject *parent = NULL) : QThread(parent) {
overlay = o;
keepGoing = true;
- focus = false;
- active = true;
- cameralock = new QSemaphore(1);
- parameters = new CameraParameters;
-
+ focus = false;
+ active = true;
+ cameralock = new QSemaphore(1);
+ parameters = new CameraParameters;
}
View
14 feedback.cpp
@@ -0,0 +1,14 @@
+#include "feedback.h"
+#include "QDebug"
+
+feedBack::feedBack()
+{
+ msgr = new Messenger();
+}
+
+void feedBack::doAction(){
+ msgr->emitPhotoTaken();
+
+}
+
+
View
29 feedback.h
@@ -0,0 +1,29 @@
+#ifndef FEEDBACK_H
+#define FEEDBACK_H
+#include "FCam/Action.h"
+#include <QObject>
+#include <QDebug>
+
+class Messenger : public QObject{
+ Q_OBJECT
+ public:
+ Messenger(){
+ }
+ void emitPhotoTaken(){
+ emit photoTaken();
+ qDebug()<<"feedback";
+ }
+ signals:
+ void photoTaken();
+};
+
+class feedBack : public FCam::CopyableAction<feedBack>{
+public:
+ feedBack();
+ Messenger* msgr;
+ void doAction();
+};
+
+
+
+#endif // FEEDBACK_H
View
BIN halftoneBlack.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
6 qtc_packaging/debian_harmattan/changelog
@@ -1,3 +1,9 @@
+rawcam (1.0.0) unstable; urgency=low
+ * Feedback when photo taken
+ * Overlay bug finally fixed
+
+ -- Michael Demetriou <qwazix@unknown> Mon, 01 Oct 2012 22:23:38 +0300
+
rawcam (0.0.9) unstable; urgency=low
* Optified and called through invoker
View
15 rawcam.cpp
@@ -21,6 +21,7 @@
#include "myproximitysensor.h"
#include "CameraParameters.h"
#include "dot.h"
+#include "feedback.h"
QTM_USE_NAMESPACE
@@ -133,6 +134,19 @@ int main(int argc, char **argv) {
gainInfo->setFont(QFont("Nokia Pure Text", 20, 200, false));
QObject::connect(cameraThread,SIGNAL(gainInfo(QString)), gainInfo, SLOT(setText(QString)));
+ //photo captured notification
+ QLabel* success = new QLabel("Photo captured",window);
+ success->move(50,50);
+ success->resize(754, 50);
+ success->setFont(QFont("Nokia Pure Text", 20, 200, false));
+ success->hide();
+ success->setObjectName("success");
+ QTimer* successTimer = new QTimer();
+ successTimer->setSingleShot(true);
+ successTimer->setInterval(4000);
+ QObject::connect(successTimer, SIGNAL(timeout()), success, SLOT(hide()));
+ QObject::connect(cameraThread->feedback.msgr,SIGNAL(photoTaken()), success, SLOT(show()));
+ QObject::connect(cameraThread->feedback.msgr,SIGNAL(photoTaken()), successTimer, SLOT(start()));
CameraParameters* params = cameraThread->parameters;
@@ -377,5 +391,6 @@ int main(int argc, char **argv) {
app.exec();
while (cameraThread->writer.savesPending() > 0) sleep(1);
+ delete cameraThread;
}
View
7 rawcam.pro
@@ -18,12 +18,14 @@ HEADERS += OverlayWidget.h CameraThread.h ExampleOverlayWidget.h \
myproximitysensor.h \
CameraParameters.h \
LEDBlinker.h \
- dot.h
+ dot.h \
+ feedback.h
SOURCES += rawcam.cpp OverlayWidget.cpp CameraThread.cpp ExampleOverlayWidget.cpp \
myproximitysensor.cpp \
CameraParameters.cpp \
LEDBlinker.cpp \
- dot.cpp
+ dot.cpp \
+ feedback.cpp
@@ -53,6 +55,7 @@ style.files = style.css \
flashFull.png flashFullGrey.png \
flashHalf.png flashHalfGrey.png \
backCurtain.png backCurtainGrey.png \
+ halftoneBlack.png \
gallery.png settings.png settings.qml
View
5 style.css
@@ -144,3 +144,8 @@ QSlider::groove:vertical {
margin: 0 -6px; /* handle is placed by default on the contents rect of the groove. Expand outside the groove */
border-radius: 15px;
}
+
+QLabel#success{
+ border: 2px solid white;
+ background: url(/opt/rawcam/halftoneBlack.png);
+}

0 comments on commit 70de4ed

Please sign in to comment.