Changeset 48


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

Position Slider working

Files:
3 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) 
  • gui/main_window.h

    r42 r48  
    3434        QSortFilterProxyModel libraryProxyModel; 
    3535        bool slidingVolume; 
     36        bool slidingPosition; 
    3637        QIcon icon; 
    3738 
     
    4748        void showPreferencesDialog(); 
    4849        void showAboutDialog(); 
     50        void positionSliderPressed(); 
     51        void positionSliderReleased(); 
    4952        void volumeSliderPressed(); 
    5053        void volumeSliderReleased(); 
     
    5457        void previousTrack(); 
    5558        void setVolume(); 
     59        void setPosition(); 
    5660        void setRandom(int); 
    5761        void setRepeat(int); 
  • lib/mpdconnection.cpp

    r19 r48  
    350350    data += QByteArray::number(time); 
    351351    sendCommand(data); 
     352 
     353    if(!commandOk()) 
     354        qDebug("Couldn't seek"); 
    352355} 
    353356 
Note: See TracChangeset for help on using the changeset viewer.