×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    13

    Timing a function

    Hi everyone, here's my doubt :

    There is any way to use a function during an specific time? The idea is to call a function, and tell the function to be used only during x seconds. The function I'm talking about, just mutes the audio file that is sounding. In other words, I'm trying to implement a function which while listening to a song, if you press a key (anyone) you will mute the audio file during those x seconds.

    Thanks in advance :-)

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: Timing a function

    Hi,

    I'm not sure I understand. Do you mean you want to press a key and hold it down, and while it's down you want the audio to be muted? If so, you can probably do it by calling the function when the key press even is detected and then calling another function, which resets the volume, when the key release event is detected.

    Please try to explain the situation again.

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    13

    Re: Timing a function

    Hi Bogdan, thanks for your interest.

    What I meant is: I just want to press the key once, just a simple press. Once I've pressed the key (I'm not holding it down or pressing again), the mute function is activated during x seconds. When those x seconds have passed, the function mute is not used anymore and the volume is reset.
    Is this explanation clearer?

    Danko

  4. #4
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: Timing a function

    Yes. Well all you have to do is call the function that sets the volume to 0 and use a timer (more information in the PyS60 Library Reference, the part about Ao_timer) to call the function that resets the volume once x seconds have passed. There's a somewhat close example here.

  5. #5
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: Timing a function

    hello Danko22

    just to add something to bogdans answer, please have a look at this wiki article about how not to use timers.

    Regards
    Gaba88

Similar Threads

  1. ShortMsgReceived - Delphi
    By qb_soft in forum PC Suite API and PC Connectivity SDK
    Replies: 9
    Last Post: 2008-06-22, 10:30
  2. Help with lnk2019 lnk1120 error
    By yuenfatt in forum Symbian
    Replies: 8
    Last Post: 2007-08-24, 08:21
  3. a function return value problem
    By letmefly111 in forum Symbian
    Replies: 3
    Last Post: 2007-07-23, 20:50
  4. C-code..unable to make sis
    By Symbian_Neil in forum Symbian
    Replies: 9
    Last Post: 2006-12-02, 07:55
  5. Problem with Nokia D211 Linux Drivers
    By fiveam in forum Multimodecards
    Replies: 1
    Last Post: 1970-01-01, 02:00

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×