Version: 2.2.1 (using 4.3.3 (KDE 4.3.3) "release 3", KDE:43 / openSUSE_11.2) Compiler: gcc OS: Linux (x86_64) release 2.6.31.5-0.1-desktop When I practice playing an instrument I often need to restart the song that is currently played. (My old CD-Player does this by simply pressing the play-button. It has an extra button for pause). I'm fine not having a button for that restart-function. Expected Behaviour: When I press a shortcut, the song that is currently played starts right from the beginning.
Press "Back" or the shortcut assigned to it. This should restart the current song.
No, it makes Amarok jump to the previous song.
*** Bug 217152 has been marked as a duplicate of this bug. ***
Changing status
commit e4ecaf468202c801e52f8717af32e989ba69f14d Author: Kevin Funk <krf@electrostorm.net> Date: Thu Jul 8 18:50:16 2010 +0200 Add "Restart current track" shortcut BUG: 217081 diff --git a/ChangeLog b/ChangeLog index 338d228..d95c5f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ Amarok ChangeLog VERSION 2.3.2-Beta 1 FEATURES: + * Shortcuts: Added "Replay current track" shortcut. (BR 217081) * Edit filter dialog: added "added" and "last played" date filters. * File browser: added forward and back buttons for accessing navigate history. * Organize Dialog: added a way to save multiple file formats as presets. (BR 122672) diff --git a/src/EngineController.cpp b/src/EngineController.cpp index 7c15ab9..f17ac7b 100644 --- a/src/EngineController.cpp +++ b/src/EngineController.cpp @@ -405,6 +405,14 @@ EngineController::play( const Meta::TrackPtr& track, uint offset ) } void +EngineController::replay() // slot +{ + DEBUG_BLOCK + + seek( 0 ); +} + +void EngineController::playUrl( const KUrl &url, uint offset ) { DEBUG_BLOCK diff --git a/src/EngineController.h b/src/EngineController.h index 4efdc14..2060bd5 100644 --- a/src/EngineController.h +++ b/src/EngineController.h @@ -201,6 +201,13 @@ public slots: void play( const Meta::TrackPtr&, uint offset = 0 ); /** + * Replays the current track + * + * This is a convenience method, calls seek( 0 ) actually + */ + void replay(); + + /** * Pauses the current track * * This happens asynchronously. Use EngineObserver to find out when it actually happens. diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 178a78f..6593870 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -802,6 +802,13 @@ MainWindow::createActions() connect( action, SIGNAL( triggered( bool ) ), pa, SLOT( back() ) ); action = new KAction( this ); + ac->addAction( "replay", action ); + action->setIcon( KIcon("media-playback-start") ); + action->setText( i18n( "Restart current track" ) ); + action->setGlobalShortcut( KShortcut() ); + connect( action, SIGNAL( triggered( bool ) ), ec, SLOT(replay()) ); + + action = new KAction( this ); ac->addAction( "repopulate", action ); action->setText( i18n( "Repopulate Playlist" ) ); action->setIcon( KIcon("view-refresh-amarok") );
Thanks Kevin! That is so nice! Guido