Changeset 48 for gui/main_window.cpp


Ignore:
Timestamp:
01/09/08 20:20:39 (4 years ago)
Author:
roeland
Message:

Position Slider working

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gui/main_window.cpp

    r43 r48  
    1414 
    1515    slidingVolume = false; 
     16    slidingPosition = false; 
    1617 
    1718    //Icon 
     
    5859    connect(volumeSlider, SIGNAL(sliderReleased()), this, SLOT(setVolume())); 
    5960    connect(volumeSlider, SIGNAL(sliderReleased()), this, SLOT(volumeSliderReleased())); 
     61    connect(positionSlider, SIGNAL(sliderPressed()), this, SLOT(positionSliderPressed())); 
     62    connect(positionSlider, SIGNAL(sliderReleased()), this, SLOT(setPosition())); 
     63    connect(positionSlider, SIGNAL(sliderReleased()), this, SLOT(positionSliderReleased())); 
    6064    connect(prevTrackButton, SIGNAL(clicked(bool)), this, SLOT(previousTrack())); 
    6165    connect(stopTrackButton, SIGNAL(clicked(bool)), this, SLOT(stopTrack())); 
     
    140144} 
    141145 
     146void MainWindow::positionSliderPressed() 
     147{ 
     148    slidingPosition = true; 
     149} 
     150 
     151void MainWindow::positionSliderReleased() 
     152{ 
     153    slidingPosition = false; 
     154} 
     155 
    142156void MainWindow::volumeSliderPressed() 
    143157{ 
     
    178192    mpd.goToPrevious(); 
    179193    mpd.getStatus(); 
     194} 
     195 
     196void MainWindow::setPosition() 
     197{ 
     198    mpd.setSeekId(mpd_status.song_id, positionSlider->value()); 
    180199} 
    181200 
     
    226245    QString timeElapsedFormattedString; 
    227246 
    228     positionSlider->setMaximum(status.time_total); 
    229     positionSlider->setValue(status.time_elapsed); 
     247    if(!slidingPosition) { 
     248        positionSlider->setMaximum(status.time_total); 
     249        positionSlider->setValue(status.time_elapsed); 
     250    } 
    230251 
    231252    if(!slidingVolume) 
Note: See TracChangeset for help on using the changeset viewer.