Bug 241066 - JJ: Add Signals trackStop and amarokShutdown to Amarok scripting interface
Summary: JJ: Add Signals trackStop and amarokShutdown to Amarok scripting interface
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Unclassified
Component: Playback (show other bugs)
Version: 2.3.1-GIT
Platform: Compiled Sources Linux
: NOR wishlist with 40 votes (vote)
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2010-06-08 02:17 UTC by Bernd Helm
Modified: 2013-03-28 20:48 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.8


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernd Helm 2010-06-08 02:17:34 UTC
Version:           2.3.1-GIT (using KDE 4.4.3) 
OS:                Linux

signals like trackStop and amarokShutdown seem to be missing from amarok 2.0 Scripting API.

trackStop: sould be emitted if the user stops the track. currently, only a trackChanged (or trackPlayPause, do not remember surely) is emitted, but as the track is fading out at this time, there is no (or i see no) easy way to find out that the track is going to stop.

amarokShutdown: this sould be emitted just before amarok shuts down and give the connected scripts a second to do actions.

sorry if i just missed something, iam new to amarok scripting. i need these kind of notification for a mood script that also change the mood when playback is stoppend or amarok is shut down.

Reproducible: Always
Comment 1 Bernd Helm 2010-08-11 20:57:54 UTC
There is also a trackInfoChanged() (or trackMetaDataChanged()) signal missing.

i.e. if you are listening to a internet radio stream, the track info changes every new track, but amarok does not give any script a note about that.

Same for single mp3 files that contain more than one track information.

amarok: BEGIN: void CurrentTrack::dataUpdated(const QString&, const Plasma::DataEngine::Data&) 
amarok: END__: void CurrentTrack::dataUpdated(const QString&, const Plasma::DataEngine::Data&) - Took 0.00087s 
amarok: BEGIN: void EngineController::slotMetaDataChanged() 
amarok:   [EngineController] Artist     :  ("") 
amarok:   [EngineController] Album      :  ("Antena Zagreb") 
amarok:   [EngineController] Title      :  ("Madonna - Sorry (Short version)") 
amarok:   [EngineController] Genre      :  ("Pop Rock") 
amarok:   [EngineController] Tracknumber:  ("") 
amarok:   [EngineController] Length     :  () 
amarok:   [EngineController] Track changed:  false 
amarok:   BEGIN: void Engine::EngineSubject::newMetaDataNotify(const QHash<long long int, QString>&, bool) 
amarok:     BEGIN: virtual void MetaStream::Track::Private::engineNewMetaData(const QHash<long long int, QString>&, bool) 
amarok:        Applying new Metadata. 
amarok:       BEGIN: void MetaStream::Track::Private::notify() const 
amarok:          Notifying observer:  0x8ddc6dc 
amarok:          Notifying observer:  0x81e8ef8 
amarok:          Notifying observer:  0x8991808 
amarok:         BEGIN: virtual void Playlist::Model::metadataChanged(Meta::TrackPtr) 
amarok:           BEGIN: void StatusBar::updateTotalPlaylistLength() 
amarok:           END__: void StatusBar::updateTotalPlaylistLength() - Took 0.00018s 
amarok:           [Playlist::Model] Metadata updated for track "Sorry (Short version)"
Comment 2 Matěj Laitl 2013-01-11 01:11:25 UTC
Shouldn't be hard, marking as JJ.
Comment 3 Akshay Ratan 2013-01-15 06:33:51 UTC
Hello I am interested in this hack !  How should I start ? Whom to contact for this ?
Comment 4 Myriam Schweingruber 2013-01-15 16:01:39 UTC
(In reply to comment #3)
> Hello I am interested in this hack !  How should I start ? Whom to contact
> for this ?

Hi there,

please read the information and links in this wiki page:  http://community.kde.org/Amarok/Development/Join. You can get in touch with us in #amarok on irc.freenode.net and subscribe to the amarok-devel@kde.org mailing list.

To hack on Amarok You should build Amarok from source. For a local build please have a look at this guide: http://blogs.fsfe.org/myriam/2009/09/compiling-amarok-from-git-locally-full-summary/
Comment 5 Anmol Ahuja 2013-03-15 13:32:10 UTC
I'm working on this bug
Comment 6 Anmol Ahuja 2013-03-24 20:57:48 UTC
https://git.reviewboard.kde.org/r/109695/
Comment 7 Matěj Laitl 2013-03-28 20:48:17 UTC
Git commit b0c79900429e8987c018112f875e09e565126408 by Matěj Laitl, on behalf of Anmol Ahuja.
Committed on 28/03/2013 at 21:44.
Pushed by laitl into branch 'master'.

AmarokWindowScript: add prepareToQuit() signal

CHANGES:
 * Add prepareToQuit() signal to Amarok.Window script bindings; patch by
   Anmol Ahuja.
FIXED-IN: 2.8
REVIEW: 109695
DIGEST: Amarok scripting interface has been enhanced with requested method

M  +2    -0    ChangeLog
M  +1    -8    src/App.cpp
M  +2    -2    src/MainWindow.cpp
M  +1    -1    src/dbus/mpris1/RootHandler.cpp
M  +1    -1    src/dbus/mpris2/MediaPlayer2.cpp
M  +1    -1    src/scriptengine/AmarokScript.cpp
M  +3    -0    src/scriptengine/AmarokWindowScript.cpp
M  +3    -0    src/scriptengine/AmarokWindowScript.h

http://commits.kde.org/amarok/b0c79900429e8987c018112f875e09e565126408