Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 12 of 12
  1. #1
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770

    Sound on mouse over and button to stop them

    I have some buttons that have a sound on mouse over and they may get to bug someone so is there a way to have a button to turn them off and back if needed?

  2. #2
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770
    Going to ask how can I show the time on the window?

  3. #3
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843
    As to the sound, just add a button with Audio.TogglePlay action. This would play/pase your audio channel.
    I did not understand your second post....

    Yossi

  4. #4
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Sure, here you go.
    Attached Files

  5. #5
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770
    Well I have 7 or 8 buttons that each have their own mouse over sound so would need to turn them all on and off .see screenshot
    Attached Images

  6. #6
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770
    I was wondering if you can display the time on the window someplace?

  7. #7
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Hi. In the example above the sound is toggled for all buttons, which should work as you want. See attached for a project which shows the time...
    Attached Files

  8. #8
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    To get rid of the mouseover and click sounds, make sure the properties pane is visible, select the buttons and set the HighLightSound and ClickSound to None. See attached image.

    I think that is what you were asking, not how to turn off the sounds at runtime.
    Last edited by Dermot; 11-14-2009 at 09:34 PM.
    Dermot

    I am so out of here

  9. #9
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770
    Thanks for the help Corey , guys.

  10. #10
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    No problem.

  11. #11
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Here is a function that I wrote that can be used to mute all button objects sound. It will find all the buttons on a page and change the properties so that their sound is set to none.

    I realize that the function would toggle everything on the page so here is one just for the button object. This function does not handle custom sounds but shouldn't be too hard to get it to do so.

    Code:
    function ToggleAudio(bAudio)
    	-- Set local variables
    	local tbObjects = {};
    	local tbProps = {};
    	local Object = nil;
    	local vSound = nil;
    	local tbObjectType = {};
    			tbObjectType[0] = Button;
    
    	--Determine if audio should be on or off and set variables
    	--so turn sound on or off as appropriate
    	if bAudio then
    		vSound = SND_STANDARD;--used for object properties
    		nVol = 100;--used for video and mediaplayer
    		--Audio.SetVolume(CHANNEL_ALL, 255);--sets audio globally for channels
    	else
    		vSound = SND_NONE;
    		nVol = 0;
    		--Audio.SetVolume(CHANNEL_ALL, 0);
    	end
    	
    	--get the objects on the page if there are objects then proceed 
    	tbObjects = Page.EnumerateObjects();
    	if tbObjects then
    		for i,v in tbObjects do --for each item in the table get the type
    			Object = tbObjectType[Page.GetObjectType(v)];
    			--if the object existed in the table above then 
    			if Object then
    				--get the properties for the object
    				tbProps = Object.GetProperties(v);
    				--set the sound properties to the variable determined above
    				tbProps.HighlightSound = vSound;
    				tbProps.ClickSound = vSound;
    				--set the properties back to the object
    				Object.SetProperties(v, tbProps);
    			end
    		end
    	end
    end
    use ToggleAudio(true) to enable sound on the buttons and ToggleAudio(false) to disable audio on button objects.

    Tigg
    Last edited by TJ_Tigger; 02-07-2006 at 07:07 AM.
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  12. #12
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Ok here is another that keeps track of custom sound buttons.

    Code:
    function ToggleAudio(bAudio)
    	-- Set local variables
    	local tbObjects = {};
    	local tbProps = {};
    	local Object = nil;
    	local vSound = nil;
    	local tbObjectType = {};
    			tbObjectType[0] = Button;
    
    	--Determine if audio should be on or off and set variables
    	--so turn sound on or off as appropriate
    	if bAudio then
    		vSound = SND_STANDARD;--used for object properties
    		nVol = 100;--used for video and mediaplayer
    		--Audio.SetVolume(CHANNEL_ALL, 255);--sets audio globally for channels
    	else
    		g_tbSndCustom = {}; --used to store custom sounds
    		vSound = SND_NONE;
    		nVol = 0;
    		--Audio.SetVolume(CHANNEL_ALL, 0);
    	end
    	
    	--get the objects on the page if there are objects then proceed 
    	tbObjects = Page.EnumerateObjects();
    	if tbObjects then
    		for i,v in tbObjects do --for each item in the table get the type
    			Object = tbObjectType[Page.GetObjectType(v)];
    			--if the object existed in the table above then 
    			if Object then
    				--get the properties for the object
    				tbProps = Object.GetProperties(v);
    				
    				--Store custom sound information in a table
    				if bAudio == false and (tbProps.HighlightSound ~= SND_STANDARD or tbProps.ClickSound ~= SND_STANDARD) then
    					g_tbSndCustom[v]={};
    					if tbProps.HighlightSound ~= SND_STANDARD then
    						g_tbSndCustom[v]["HS"] = tbProps.HighlightSound
    					end
    					if tbProps.ClickSound ~= SND_STANDARD then
    						g_tbSndCustom[v]["CS"] = tbProps.ClickSound
    					end
    				end
    				
    				--set the sound properties to the variable determined above
    				if bAudio and g_tbSndCustom[v] then -- If Both are true then the item contains custom sound
    					if g_tbSndCustom[v]["HS"] then
    						tbProps.HighlightSound = g_tbSndCustom[v]["HS"]
    					end
    					if g_tbSndCustom[v]["CS"] then
    						tbProps.ClickSound = g_tbSndCustom[v]["CS"]
    					end
    				else
    					tbProps.HighlightSound = vSound;
    					tbProps.ClickSound = vSound;
    				end
    				
    				--set the properties back to the object
    				Object.SetProperties(v, tbProps);
    			end
    		end
    	end
    end
    
    if bAudio then
    	ToggleAudio(false);
    	bAudio = false;
    else
    	ToggleAudio(true);
    	bAudio = true;
    end
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

Posting Permissions

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