Discussion Board

Results 1 to 8 of 8
  1. #1
    Regular Contributor viktor_m's Avatar
    Join Date
    Mar 2003
    Posts
    104
    Hi all,

    What is the right way to stop MusicPlayer application on Symbian 3rd edition phones?
    My application plays audio and if the MusicPlayer is running in backgroumd, both audios are playing simultaneously.

    I would expect that MusicPlayer has a highest priority and my application would not play.
    But CMdaAudioPlayerUtility client do plays the sound at the same time as MusicPlayer with or without MultimediaDD capability. CVideoPlayerUtility client usually unable to start the video with sound when MusicPlayer is running, but on some devices it also plays audio while MusicPlayer is playing.

    To stop the MusicPlayer I tried:
    TApaTask::EndTask();
    TApaTask::KillTask();
    This work on old devices but does not work on FP1 devices.

    I tried playing with CRemConCoreApiController like this:
    Code:
    	iRemConCoreApiController = CRemConCoreApiController::NewL(*iSelector, *this);
    	iTarget = CRemConCoreApiTarget::NewL( *iSelector, *this ); 
    	iSelector->OpenTargetL();
    	iSelector->OpenControllerL();
    	TRequestStatus  status;
    	TUint numRemotes = 0;
    	TRemConCoreApiButtonAction butAct = ERemConCoreApiButtonClick;
    	iRemConCoreApiController->Stop(status, numRemotes, butAct);
    	User::WaitForRequest(status);
    This does not work.

    I also tried CMPlayerRemoteControl extended api for 3rd ed. FP1.
    Code:
    iMPlayerRemoteControl = MPlayerRemoteControlFactory::NewRemoteControlL();
    iMPlayerRemoteControl->HandleCommand(EMPlayerRCtrlCmdStop);
    it works on N95 with WriteDeviceData capabiluty, but does not work on N95 8GB.

    So how to stop MusicPlayer, like e.g. VisuallRadio stops it?

  2. #2
    Regular Contributor viktor_m's Avatar
    Join Date
    Mar 2003
    Posts
    104
    Maybe somebody from Nokia can make it clear.

    How audio applications:
    Music Player, Visual Radio, Sound Recorder, RealPlayer and others
    communicate with each other to stop audio playback when another audio application is started?

    How developers can programmatically stop, pause or close currently playing application?
    Actually TApaTask::EndTask() helps in most cases, it can close all apps except Music Player.
    When Music Player launched from within File Manager or Gallery, it can be closed also.

    Only Music Player itself can not be closed in this way. How to stop or pause it?

    br

  3. #3
    Regular Contributor rathodavinash's Avatar
    Join Date
    Mar 2005
    Location
    Mumbai
    Posts
    212
    Even I would like to know that.

  4. #4
    Registered User EzD2's Avatar
    Join Date
    Jan 2008
    Posts
    1
    Quote Originally Posted by viktor_m View Post
    How developers can programmatically stop, pause or close currently playing application?
    Actually TApaTask::EndTask() helps in most cases, it can close all apps except Music Player.
    When Music Player launched from within File Manager or Gallery, it can be closed also.

    Only Music Player itself can not be closed in this way. How to stop or pause it?

    br
    I had been trying to close the Music Player using TApaTask::EndTask() with no luck until I found out that PowerMgmt capability is needed in the calling application to close it. Only tested in a Nokia N73 (Symbian 9.1), though. Hope this could help someone...

    Cheers!

  5. #5
    Regular Contributor lancemachine's Avatar
    Join Date
    Nov 2006
    Location
    Chengdu China
    Posts
    169
    Consider you have a Windows Media player playing some good music, then you start a game, what would it do? pause or stop the music, or even kill Windows Media process? No game, or any other application, as far as I know, does that.
    The dream is to become one machine, or let one machine become me

  6. #6
    Registered User yfw1966's Avatar
    Join Date
    Mar 2008
    Posts
    140
    Quote Originally Posted by EzD2 View Post
    I had been trying to close the Music Player using TApaTask::EndTask() with no luck until I found out that PowerMgmt capability is needed in the calling application to close it. Only tested in a Nokia N73 (Symbian 9.1), though. Hope this could help someone...

    Cheers!
    Thanks
    In my application, TApaTask::EndTask() with the capability PowerMgmt does not work yet, but TApaTask::KillTask() with the capability PowerMgmt works fine! my application is running in s60 fp2, E75. hope it could help others.

  7. #7
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,672
    using the KillTask for the purspose is reall, really, really bad and can lead to many unwanted problems. Basically the end task is rather much safer, simply because it at least gives a chance for the player to actually do normal cleanup before exiting.

  8. #8
    Regular Contributor dahiya.vinod's Avatar
    Join Date
    Dec 2010
    Posts
    142
    nokia applications use MMPXPlaybackUtility class in Music player(I saw it in symbian source code). Refer to its various classes of this api, you my find some way to open communication with and already running instance of music player and pause it before playing your content.

    or

    Play your content using MMPXPlaybackUtility api. I think it should pause ongoing music and play your content.

    Here is a wiki link about this api.
    http://wiki.forum.nokia.com/index.ph...ck_Utility_API

Similar Threads

  1. Getting frustrated with 3rd edition C++ SDK and NCF 1.2
    By jzxu in forum Symbian Tools & SDKs
    Replies: 6
    Last Post: 2007-06-07, 09:46
  2. Getting frustrated with NCF 1.2 and 3rd edition SDK
    By jzxu in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2006-12-10, 00:15
  3. Carbide C++ AppWizards for 3rd Edition
    By ArneH in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2006-05-20, 21:22
  4. Plea for Link Errors:Porting Code from Fp3 to 3rd Edition
    By mateen_maldar in forum Symbian User Interface
    Replies: 3
    Last Post: 2006-05-17, 06:26

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved