error compiling without pulse (possible fix included) #5

Closed
opened 2023-07-30 20:14:27 +02:00 by mutax · 1 comment

In file nncmpp.c the symbols ACTION_PULSE_VOLUME_UP and ACTION_PULSE_VOLUME_DOWN are referenced, but they are not defined when compiling I guess without pulse.

I added two ifdefs to get it to compile but don't know if the patch is suitable as a general patch -- thus no PR.

diff --git a/nncmpp.c b/nncmpp.c
index 97a0031..338934a 100644
--- a/nncmpp.c
+++ b/nncmpp.c
@@ -2860,8 +2860,12 @@ app_process_mouse (termo_mouse_event_t type, int x, int y, int button,
                case WIDGET_LIST:
                        return app_process_action (ACTION_SCROLL_UP);
                case WIDGET_VOLUME:
+#ifdef ACTION_PULSE_VOLUME_UP                  
                        return app_process_action (g.pulse_control_requested
                                ? ACTION_PULSE_VOLUME_UP : ACTION_MPD_VOLUME_UP);
+#else
+                       return app_process_action (ACTION_MPD_VOLUME_UP);
+#endif                 
                case WIDGET_GAUGE:
                        return app_process_action (ACTION_MPD_FORWARD);
                }
@@ -2872,8 +2876,12 @@ app_process_mouse (termo_mouse_event_t type, int x, int y, int button,
                case WIDGET_LIST:
                        return app_process_action (ACTION_SCROLL_DOWN);
                case WIDGET_VOLUME:
+#ifdef ACTION_PULSE_VOLUME_UP                  
                        return app_process_action (g.pulse_control_requested
                                ? ACTION_PULSE_VOLUME_DOWN : ACTION_MPD_VOLUME_DOWN);
+#else
+                       return app_process_action (ACTION_MPD_VOLUME_DOWN);
+#endif                 
                case WIDGET_GAUGE:
                        return app_process_action (ACTION_MPD_BACKWARD);
                }

In file nncmpp.c the symbols ACTION_PULSE_VOLUME_UP and ACTION_PULSE_VOLUME_DOWN are referenced, but they are not defined when compiling I guess without pulse. I added two ifdefs to get it to compile but don't know if the patch is suitable as a general patch -- thus no PR. ``` diff --git a/nncmpp.c b/nncmpp.c index 97a0031..338934a 100644 --- a/nncmpp.c +++ b/nncmpp.c @@ -2860,8 +2860,12 @@ app_process_mouse (termo_mouse_event_t type, int x, int y, int button, case WIDGET_LIST: return app_process_action (ACTION_SCROLL_UP); case WIDGET_VOLUME: +#ifdef ACTION_PULSE_VOLUME_UP return app_process_action (g.pulse_control_requested ? ACTION_PULSE_VOLUME_UP : ACTION_MPD_VOLUME_UP); +#else + return app_process_action (ACTION_MPD_VOLUME_UP); +#endif case WIDGET_GAUGE: return app_process_action (ACTION_MPD_FORWARD); } @@ -2872,8 +2876,12 @@ app_process_mouse (termo_mouse_event_t type, int x, int y, int button, case WIDGET_LIST: return app_process_action (ACTION_SCROLL_DOWN); case WIDGET_VOLUME: +#ifdef ACTION_PULSE_VOLUME_UP return app_process_action (g.pulse_control_requested ? ACTION_PULSE_VOLUME_DOWN : ACTION_MPD_VOLUME_DOWN); +#else + return app_process_action (ACTION_MPD_VOLUME_DOWN); +#endif case WIDGET_GAUGE: return app_process_action (ACTION_MPD_BACKWARD); } ```
Owner

Thank you for noticing my oversight, I'll take care of it.

Thank you for noticing my oversight, I'll take care of it.
p closed this issue 2023-08-01 02:39:19 +02:00
Sign in to join this conversation.
No Label
WIP
easy
priority
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: p/nncmpp#5
No description provided.