Thursday, July 28, 2011

Today my next version of Audiobook reader application got published on Ovi Store. This version include some new feature with some other impoverishment.

New feature are as below,

Chapter Selection, If Audiobook has multiple audio file for individual chapter then now you can select and play individual chapter.

Custom Bookmark support, In case Audiobook is one large audio file and you found some interesting chapter then you can add bookmark, Bookmark will save play position. Latter if you wish to hear that chapter, you can go to bookmark screen and play that bookmark.

Both bookmark and chapter selection feature are available from main Booklist screen. In following snap, by pressing icon next to play icon will lead you to bookmark/ chapter screen.

Following is Chapter/Bookmark Screen. By pressing Icon next to back icon, will show chapter or bookmark screen.

In following snaps is showing chapter screen. On this screen if you press book icon, it will switch screen to bookmark screen.

Following snap is showing Bookmark screen, by pressing list icon you can switch back to Chapter Screen.

You can add custom bookmark from player screen, by pressing + icon and then entering bookmark name on Add Bookmark dialog.

Hope you will like this new feature, If you have any comment please feel free to add comment.

Now the interesting functions comes that enable pause/resume functionality to download manager. Following is pause function. If simply abort current request, disconnect the signal/slot so we don't get any error signal and mess with our error handling code and most importantly it write data to our IODevice here its file which is storing downloaded data.

Now the resume function. So most important thing here is "Range" header. It tell the server that I want to start download from this much bytes and not from beginning, because we already received this much data when we paused the request.

Another important function, if you want to show correct progress. Remember to add mDownloadSizeAtPause (number of bytes already downloded when we pause the request ) to bytesReceived and bytesTotal, function to show correct progress.

Sunday, July 17, 2011

Now its raining heavily here and that provided me some free time to play with my iPod. As I was using my iPod I got curious about how that "swipe to unlock" animation could have been implemented.

I decided to implement such animation my self with QML and following is output of my effort.

If you also curious about how it can be implemented, than solution is quite simple.
The code is similar to code for Marquee text animation. To give marquee text effect, I used to change position of text element only. Here I change position of both text and parent Item element.

Here is full code. In code I created one static text in gray color which is fully visible and another text with white color which is partially visible only ans used for scrolling animation. I put this animating text inside Item element.

Now on timer event, I am increasing x position of Item element with some delta , at same time I am also reducing same delta from text x position. This will give effect as color or gray static text is changing.

Saturday, July 16, 2011

I have tried 2-3 shutter glasses from Samsung and I feel that glasses which I got with TV put less strain on eyes and don't feel flicker of LCD of shutter glasses with this model.

As soon as I got it, I tried to play some HD content on it and result looks great from 4-5 feet distance.

It got one USB port and 3 HDMI port. We can plug USB drive and play video from it. You need to select USB drive as input source and then it will show file manager and there you can browse for content. It has inbuilt movie player. Which play movie from USB drive. I tried to use this inbuilt media player and found it quite nice and useful. It recognize many video format include mp4 and divx. I also tried some mkv file which has dual audio support. It can play that source as well and allow to change language.

Now that I tried 2D content, I wanted to try some 3d content.

To watch 3d content,I connected my laptop via HDMI cable and made my tv primary monitor then played some 3d content from youtube.

It took me quite some time to figure out that, that to watch 3d content from 3d tv. I need to play video that is in half side by side (half sbs) format other kind of video want give 3d effect with 3d tv with shutter technology.

After starting half sbs movie, you need change to 3D mode from 2D and select side by side format. Now put on glasses and can enjoy 3D content.

After playing 3D content from my laptop, I downloaded some sample half SBS 3D content and tied to play it with its inbuilt media player. I feel that content looks great on inbuilt player than from PC.

Thats all now I am going to watch some moive on my new Tv. Thanks for reading.

Tuesday, July 5, 2011

Recently in one of my project I required to embed QWidget derived class to QML scene. While its straight forward to embed QML scene to QWidget or QGraphicsScene.

It required small effort to embed QWidget derived class to QML scene. Still its not great effort and its also vary straigt forward.

All you need to do is, create new class derived from QDeclarativeItem. Create instance of required widget and add that widget to QGraphicsProxyWidget. Now we need to register this newly created class to QML using qmlRegisterType. Now we can use this class from QML which display our QWidget derived class.

Following is code that demonstrate the same. For demo I have created class which embed QLabel to QML scene.

Following code is my custom QDeclarativeItem derive class which will expose QLabel to QML scene.

Following code demonstrate how to register above class to QML. In qmlRegisterType first argument is component uri, which is used for importing component to QML. second and third argument is version information and fourth argument is element name in QML, By using this name we can created QML element.