You Are Here:

Community: Developer Discussion Boards

#1 Old Timing a function - 2009-06-29, 14:10

Join Date: May 2009
Posts: 13
Danko22
Offline
Registered User
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 :-)
Reply With Quote

#2 Old Re: Timing a function - 2009-06-29, 14:16

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Offline
Forum Nokia Champion
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.
Reply With Quote

#3 Old Re: Timing a function - 2009-06-29, 14:52

Join Date: May 2009
Posts: 13
Danko22
Offline
Registered User
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
Reply With Quote

#4 Old Re: Timing a function - 2009-06-29, 14:58

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Offline
Forum Nokia Champion
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.
Reply With Quote

#5 Old Re: Timing a function - 2009-06-29, 19:10

Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Offline
Forum Nokia Champion
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


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
ShortMsgReceived - Delphi qb_soft PC Suite API and PC Connectivity SDK 9 2008-06-22 11:30
Help with lnk2019 lnk1120 error yuenfatt General Symbian C++ 8 2007-08-24 09:21
a function return value problem letmefly111 General Symbian C++ 3 2007-07-23 21:50
C-code..unable to make sis Symbian_Neil General Symbian C++ 9 2006-12-02 08:55
Problem with Nokia D211 Linux Drivers fiveam Multimodecards 1 1970-01-01 02:00

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia