@@ -333,17 +333,21 @@ static void *ClockThread(void *arg) {
333333 * Global functions
334334 */
335335
336- void MainApp_SlideLeft () {
336+ void MainApp_SlideLeft (GUI_Widget * widget ) {
337337 if (self .cur_x > 0 ) {
338- ds_sfx_play (DS_SFX_SLIDE );
338+ if (widget == NULL ) {
339+ ds_sfx_play (DS_SFX_SLIDE );
340+ }
339341 self .cur_x -= self .panel_area .w ;
340342 GUI_PanelSetXOffset (self .panel , self .cur_x );
341343 }
342344}
343345
344- void MainApp_SlideRight () {
346+ void MainApp_SlideRight (GUI_Widget * widget ) {
345347 if (self .x > self .cur_x ) {
346- ds_sfx_play (DS_SFX_SLIDE );
348+ if (widget == NULL ) {
349+ ds_sfx_play (DS_SFX_SLIDE );
350+ }
347351 self .cur_x += self .panel_area .w ;
348352 GUI_PanelSetXOffset (self .panel , self .cur_x );
349353 }
@@ -407,11 +411,11 @@ static void Slide_EventHandler(void *ds_event, void *param, int action) {
407411 case SDL_JOYBUTTONDOWN :
408412 switch (event -> jbutton .button ) {
409413 case SDL_DC_L :
410- MainApp_SlideLeft ();
414+ MainApp_SlideLeft (NULL );
411415 break ;
412416
413417 case SDL_DC_R :
414- MainApp_SlideRight ();
418+ MainApp_SlideRight (NULL );
415419 break ;
416420
417421 default :
@@ -423,11 +427,11 @@ static void Slide_EventHandler(void *ds_event, void *param, int action) {
423427 switch (event -> key .keysym .sym )
424428 {
425429 case SDLK_COMMA :
426- MainApp_SlideLeft ();
430+ MainApp_SlideLeft (NULL );
427431 break ;
428432
429433 case SDLK_PERIOD :
430- MainApp_SlideRight ();
434+ MainApp_SlideRight (NULL );
431435 break ;
432436
433437 default :
0 commit comments