Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configured sounds not playing (Up, Down, Left, Right) #555

Open
OzFalcon opened this Issue Apr 5, 2019 · 7 comments

Comments

Projects
None yet
3 participants
@OzFalcon
Copy link

commented Apr 5, 2019

Attract Mode V2.5.1 running on Linux.
Some configured sound files are not playing.
Event sound files for Up, Down, Left, Right are not playing.
But other events (Select, Previous/Next Page, Previous/Next Game) are working.

"--loglevel debug" Doesn't seem to show any problems regarding config.

Command intercepted by script handler: right
Command intercepted by script handler: left
Command intercepted by script handler: down
[Transition] type=EndNavigation, var=0
Command intercepted by script handler: up
[Transition] type=EndNavigation, var=0

I am using the Grid layout with some minor aesthetic changes but nothing that should alter standard operation.
Configure_Sound
Simple_Grid

@randombyt

This comment has been minimized.

Copy link

commented Apr 11, 2019

If you are using "fe.get_input_state" function then direction keys will only affect keyboard input not gamepad inputs (which will be in this format "Joy0 Down").

@zpaolo11x

This comment has been minimized.

Copy link

commented Apr 12, 2019

If you are using "fe.get_input_state" function then direction keys will only affect keyboard input not gamepad inputs (which will be in this format "Joy0 Down").

Good to know, what if I have a signal callback routine and I attach sounds to the "left" "right" events? Will it work with a joypad / joystick too? (I don't have one to test :( )

@OzFalcon

This comment has been minimized.

Copy link
Author

commented Apr 12, 2019

I'm using a stripped down grid layout.
The grid layout doesn't use "fe.get_input_state" looking at the layout.nut file.
For input there is only keyboard - A standard I-Pac device. I havn't tried a Joystick/Gamepad.
Attached is the Grid Runner layout nut file for reference.
It still needs the frame.png found in Grid layout to operate.
layout.nut.txt

@zpaolo11x

This comment has been minimized.

Copy link

commented Apr 12, 2019

Some things I'll try: the same audio file that doesn't play when attached to left/right etc is working if attached to other events like "esc" or "back"? Other sound files work if attached to left/right etc? Last but not least, does it work in any other layout?

@OzFalcon

This comment has been minimized.

Copy link
Author

commented Apr 12, 2019

Yes, The audio file works with other events.
For example: When moving toward the edge (Top/Bottom/LeftSide/RightSide) the events
fe.signal( "prev_game" );
fe.signal( "next_game" );
fe.signal( "prev_page" );
fe.signal( "next_page" );
are triggered and will play the audio file (If configured).
But just moving around within the layout (Not pushing an edge) does not play the Up/Down/Left/Right audio files.

I havn't tried with other layouts as yet, But will have a poke around this weekend and learn a little more on how things operate.

@OzFalcon

This comment has been minimized.

Copy link
Author

commented Apr 12, 2019

Ok, I think I have it working in some fashion.

Standard movement within the layout adjusts the "sel_y" or "sel_x" values then calls "update_frame".
No events are actually called from within "update_frame" function (Or the "get_sel" function).

	function update_frame()
	{
		frame.x = width * sel_x;
		frame.y = fe.layout.height / 24 + height * sel_y;
		
		name_t.index_offset = num_t.index_offset = get_sel() - selection_index;	
	}
	function get_sel()
	{
		return vert_flow ? ( sel_x * rows + sel_y ) : ( sel_y * cols + sel_x );
	}

To enable sound "custom1" signal is configured to the audio file and called before the "update_frame" function.

		switch ( sig )	
		{
		case "up":
			if ( sel_y > 0 )
			{
				sel_y--;
				fe.signal( "custom1" );
				update_frame();
			}

I'm still not sure if this is the "Correct" way to do it, But it does work.

@randombyt

This comment has been minimized.

Copy link

commented Apr 15, 2019

If you are using "fe.get_input_state" function then direction keys will only affect keyboard input not gamepad inputs (which will be in this format "Joy0 Down").

Good to know, what if I have a signal callback routine and I attach sounds to the "left" "right" events? Will it work with a joypad / joystick too? (I don't have one to test :( )

Signal callback works as intended with both keyboard and gamepad. AFAIK only Input_state differs between keyboard input (i.e. "Down") and gamepad input (i.e. "Joy0 Down").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.