Results 1 to 1 of 1

Thread: time displayer not working in media player

  1. #1
    Join Date
    Jul 2010
    Posts
    50
    Platforms
    Windows
    Thanks
    7

    Default time displayer not working in media player

    I havbe made a media player...... I have used the code of timer of "media Player " example of Qt but it is not working........ if anybody could tell me the cause,...........here's the code:
    Qt Code:
    1. //In class VideoPlayer
    2. connect(videoPlayerControls->slider,SIGNAL(valueChanged()),videoDisplayer,SLOT(updateTime()));
    3.  
    4. //In class VideoDisplayer
    5. void VideoDisplayer::updateTime()
    6. {
    7. int msec = totalTime;
    8. int sec = msec/1000;
    9. int min = sec/60;
    10. int hour = min/60;
    11.  
    12. QTime stopTime(hour%60, min%60, sec%60, msec%1000);
    13.  
    14. int currentTime = i*40;
    15. msec = currentTime;
    16. sec = msec/1000;
    17. min = sec/60;
    18. hour = min/60;
    19. QTime playTime(hour%60, min%60, sec%60, msec%1000);
    20. QString timeFormat = "m:ss";
    21.  
    22.  
    23. if(hour > 0)
    24. timeFormat = "h:mm:ss";
    25. timeString = playTime.toString(timeFormat);
    26. //timeString = "";
    27. if(totalTime)
    28. timeString += " / " + stopTime.toString(timeFormat);
    29. localDisplayerTimeLabel->setText(timeString);
    30. localDisplayerTimeLabel->show();
    31. }
    To copy to clipboard, switch view to plain text mode 
    I have come to know about the problem..the updateTime function is not working...can anybody tell why is it so......as the slider is working correctly..
    Last edited by qt_user; 16th August 2010 at 11:07.

Similar Threads

  1. media player problem
    By emrez in forum Qt Programming
    Replies: 1
    Last Post: 16th July 2010, 18:50
  2. How to create media player in qtopia
    By Yeshwin in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 31st March 2009, 11:41
  3. How to insert media player in QDialog ?
    By merry in forum Qt Programming
    Replies: 3
    Last Post: 25th August 2008, 13:26
  4. Media Player for Windows.
    By merry in forum Qt Programming
    Replies: 6
    Last Post: 5th March 2008, 07:49
  5. media player in qtopia
    By sar_van81 in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 19th December 2007, 12:35

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.