Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Media Player time
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Media Player time

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 535 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hello, I am trying to get current time of song playing and I tried to get through slider... I got the time but its not accurate... It always late 2 seconds...
    I tested with a song that is long 1:17... Song supposed to end when "current time label" reach 1:17, but it always end when "current time label" reach 1:15... "Current time label" is 2 seconds behind the real time...

    Thats how I did that...
    @String newtime;
    int vals = ui->posSlider->value();
    int hourss = vals/(10006060);
    int minutess = (vals-(hourss10006060))/(100060);
    int secondss = (vals-(minutess100060)-(hours100060*60))/1000;

    newtime.append(QString( "%1" ).arg(minutess, 2, 10, QLatin1Char('0')) + ":" +
    QString( "%1" ).arg(secondss, 2, 10, QLatin1Char('0')));
    ui->label_3->setText(newtime);@

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved