You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(21) |
Aug
(12) |
Sep
(4) |
Oct
(13) |
Nov
(124) |
Dec
(35) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(19) |
Feb
(1) |
Mar
(10) |
Apr
(1) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(50) |
Oct
|
Nov
(15) |
Dec
(39) |
| 2008 |
Jan
(89) |
Feb
(1) |
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
(7) |
Feb
(7) |
Mar
(2) |
Apr
(23) |
May
(3) |
Jun
(10) |
Jul
(5) |
Aug
|
Sep
|
Oct
(3) |
Nov
|
Dec
|
| 2010 |
Jan
(3) |
Feb
(4) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(2) |
| 2011 |
Jan
(2) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <ane...@us...> - 2009-01-03 05:34:57
|
Revision: 464
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=464&view=rev
Author: aneurysm9
Date: 2009-01-03 05:34:51 +0000 (Sat, 03 Jan 2009)
Log Message:
-----------
Battery status monitoring courtesy of Pieter De Wit <pi...@in...>
New #defines and magic number cleanups as well
Modified Paths:
--------------
trunk/g15daemon-clients/g15stats/Makefile.am
trunk/g15daemon-clients/g15stats/configure.in
trunk/g15daemon-clients/g15stats/g15stats.c
Added Paths:
-----------
trunk/g15daemon-clients/g15stats/g15stats.h
Modified: trunk/g15daemon-clients/g15stats/Makefile.am
===================================================================
--- trunk/g15daemon-clients/g15stats/Makefile.am 2008-07-26 23:43:34 UTC (rev 463)
+++ trunk/g15daemon-clients/g15stats/Makefile.am 2009-01-03 05:34:51 UTC (rev 464)
@@ -2,6 +2,7 @@
AM_CFLAGS = -O3 -Wall @CFLAGS@ -I$(top_builddir) -I$(top_srcdir)
METASOURCES = AUTO
bin_PROGRAMS = g15stats
+noinst_HEADERS = g15stats.h
docdir = $(prefix)/share/doc/$(PACKAGE)-$(VERSION)
doc_DATA = README ChangeLog AUTHORS NEWS COPYING
@@ -9,6 +10,6 @@
LIBS = -lg15daemon_client -lg15render
IMCLUDES = -I
g15stats_LDFLAGS = -avoid-version
-g15stats_SOURCES = g15stats.c
+g15stats_SOURCES = g15stats.c g15stats.h
Modified: trunk/g15daemon-clients/g15stats/configure.in
===================================================================
--- trunk/g15daemon-clients/g15stats/configure.in 2008-07-26 23:43:34 UTC (rev 463)
+++ trunk/g15daemon-clients/g15stats/configure.in 2009-01-03 05:34:51 UTC (rev 464)
@@ -1,7 +1,7 @@
-AC_INIT(g15stats,[1.0], [mla...@us...])
+AC_INIT(g15stats,[1.1], [mla...@us...])
PACKAGE=g15stats
-VERSION=1.0
+VERSION=1.1
AC_PREFIX_DEFAULT(/usr)
AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
Modified: trunk/g15daemon-clients/g15stats/g15stats.c
===================================================================
--- trunk/g15daemon-clients/g15stats/g15stats.c 2008-07-26 23:43:34 UTC (rev 463)
+++ trunk/g15daemon-clients/g15stats/g15stats.c 2009-01-03 05:34:51 UTC (rev 464)
@@ -26,7 +26,7 @@
This is a cpu and memory stats client
*/
-
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -51,10 +51,10 @@
#include <glibtop/swap.h>
#include <glibtop/loadavg.h>
#include <glibtop/uptime.h>
+#include "g15stats.h"
int g15screen_fd;
int cycle = 0;
-#define MAX_NET_HIST 107
unsigned int net_hist[MAX_NET_HIST][2];
int net_rr_index=0;
@@ -156,24 +156,24 @@
glibtop_get_mem(&mem);
sprintf(tmpstr,"Usr %2.f%%",((float)mem.user/(float)mem.total)*100);
- g15r_renderString (canvas, (unsigned char*)tmpstr, 0, G15_TEXT_MED, 1, 2);
+ g15r_renderString (canvas, (unsigned char*)tmpstr, 0, G15_TEXT_MED, TEXT_LEFT, 2);
sprintf(tmpstr,"Buf %2.f%%",((float)mem.buffer/(float)mem.total)*100);
- g15r_renderString (canvas, (unsigned char*)tmpstr, 0, G15_TEXT_MED, 1, 14);
+ g15r_renderString (canvas, (unsigned char*)tmpstr, 0, G15_TEXT_MED, TEXT_LEFT, 14);
sprintf(tmpstr,"Che %2.f%%",((float)mem.cached/(float)mem.total)*100);
- g15r_renderString (canvas, (unsigned char*)tmpstr, 0, G15_TEXT_MED, 1, 26);
+ g15r_renderString (canvas, (unsigned char*)tmpstr, 0, G15_TEXT_MED, TEXT_LEFT, 26);
- g15r_drawBar(canvas,43,1,150,10,1,mem.user,mem.total,4);
- g15r_drawBar(canvas,43,12,150,21,1,mem.buffer,mem.total,4);
- g15r_drawBar(canvas,43,23,150,32,1,mem.cached,mem.total,4);
- drawBar_reversed(canvas,43,1,150,32,1,mem.free,mem.total,5);
+ g15r_drawBar(canvas,BAR_START,1,BAR_END,10,G15_COLOR_BLACK,(mem.user/1024),(mem.total/1024),4);
+ g15r_drawBar(canvas,BAR_START,12,BAR_END,21,G15_COLOR_BLACK,(mem.buffer/1024),(mem.total/1024),4);
+ g15r_drawBar(canvas,BAR_START,23,BAR_END,32,G15_COLOR_BLACK,(mem.cached/1024),(mem.total/1024),4);
+ drawBar_reversed(canvas,BAR_START,1,BAR_END,32,G15_COLOR_BLACK,(mem.free/1024),(mem.total/1024),5);
- g15r_drawLine (canvas, 40, 1, 40, 32, 1);
- g15r_drawLine (canvas, 41, 1, 41, 32, 1);
+ g15r_drawLine (canvas, VL_LEFT, 1, VL_LEFT, 32, G15_COLOR_BLACK);
+ g15r_drawLine (canvas, VL_LEFT+1, 1, VL_LEFT+1, 32, G15_COLOR_BLACK);
- g15r_renderString (canvas, (unsigned char*)"F", 0, G15_TEXT_MED, 152, 4);
- g15r_renderString (canvas, (unsigned char*)"R", 1, G15_TEXT_MED, 152, 4);
- g15r_renderString (canvas, (unsigned char*)"E", 2, G15_TEXT_MED, 152, 4);
- g15r_renderString (canvas, (unsigned char*)"E", 3, G15_TEXT_MED, 152, 4);
+ g15r_renderString (canvas, (unsigned char*)"F", 0, G15_TEXT_MED, TEXT_RIGHT, 4);
+ g15r_renderString (canvas, (unsigned char*)"R", 1, G15_TEXT_MED, TEXT_RIGHT, 4);
+ g15r_renderString (canvas, (unsigned char*)"E", 2, G15_TEXT_MED, TEXT_RIGHT, 4);
+ g15r_renderString (canvas, (unsigned char*)"E", 3, G15_TEXT_MED, TEXT_RIGHT, 4);
sprintf(tmpstr,"Memory Used %dMb | Memory Total %dMb",(unsigned int)((mem.buffer+mem.cached+mem.user)/(1024*1024)),(unsigned int)(mem.total/(1024*1024)));
g15r_renderString (canvas, (unsigned char*)tmpstr, 0, G15_TEXT_SMALL, 80-(strlen(tmpstr)*4)/2, 36);
@@ -188,21 +188,21 @@
glibtop_get_swap(&swap);
- g15r_renderString (canvas, (unsigned char*)"Swap", 0, G15_TEXT_MED, 1, 9);
+ g15r_renderString (canvas, (unsigned char*)"Swap", 0, G15_TEXT_MED, TEXT_LEFT, 9);
sprintf(tmpstr,"Used %i%%",(unsigned int)(((float)swap.used/(float)swap.total)*100));
- g15r_renderString (canvas, (unsigned char*)tmpstr, 0, G15_TEXT_MED, 1, 19);
+ g15r_renderString (canvas, (unsigned char*)tmpstr, 0, G15_TEXT_MED, TEXT_LEFT, 19);
- g15r_drawBar(canvas,43,1,150,32,1,(swap.used/1024),swap.total/1024,4);
+ g15r_drawBar(canvas,BAR_START,1,BAR_END,32,G15_COLOR_BLACK,(swap.used/1024),swap.total/1024,4);
- drawBar_reversed(canvas,43,1,150,32,1,(swap.total/1024)-(swap.used/1024),swap.total/1024,5);
+ drawBar_reversed(canvas,BAR_START,1,BAR_END,32,G15_COLOR_BLACK,(swap.total/1024)-(swap.used/1024),swap.total/1024,5);
- g15r_drawLine (canvas, 40, 1, 40, 32, 1);
- g15r_drawLine (canvas, 41, 1, 41, 32, 1);
+ g15r_drawLine (canvas, VL_LEFT, 1, VL_LEFT, 32, G15_COLOR_BLACK);
+ g15r_drawLine (canvas, VL_LEFT+1, 1, VL_LEFT+1, 32, G15_COLOR_BLACK);
- g15r_renderString (canvas, (unsigned char*)"F", 0, G15_TEXT_MED, 152, 4);
- g15r_renderString (canvas, (unsigned char*)"R", 1, G15_TEXT_MED, 152, 4);
- g15r_renderString (canvas, (unsigned char*)"E", 2, G15_TEXT_MED, 152, 4);
- g15r_renderString (canvas, (unsigned char*)"E", 3, G15_TEXT_MED, 152, 4);
+ g15r_renderString (canvas, (unsigned char*)"F", 0, G15_TEXT_MED, TEXT_RIGHT, 4);
+ g15r_renderString (canvas, (unsigned char*)"R", 1, G15_TEXT_MED, TEXT_RIGHT, 4);
+ g15r_renderString (canvas, (unsigned char*)"E", 2, G15_TEXT_MED, TEXT_RIGHT, 4);
+ g15r_renderString (canvas, (unsigned char*)"E", 3, G15_TEXT_MED, TEXT_RIGHT, 4);
sprintf(tmpstr,"Swap Used %dMb | Swap Avail. %dMb",(unsigned int)(swap.used/(1024*1024)),(unsigned int)(swap.total/(1024*1024)));
g15r_renderString (canvas, (unsigned char*)tmpstr, 0, G15_TEXT_SMALL, 80-(strlen(tmpstr)*4)/2, 36);
@@ -255,18 +255,18 @@
sprintf(tmpstr,"Nce %2.f%%",((float)b_nice/(float)b_total)*100);
g15r_renderString (canvas, (unsigned char*)tmpstr, 0, G15_TEXT_MED, 1, 26);
- g15r_drawBar(canvas,43,1,150,10,1,b_user+1,b_total,4);
- g15r_drawBar(canvas,43,12,150,21,1,b_sys+1,b_total,4);
- g15r_drawBar(canvas,43,23,150,32,1,b_nice+1,b_total,4);
- drawBar_reversed(canvas,43,1,150,32,1,b_idle+1,b_total,5);
+ g15r_drawBar(canvas,BAR_START,1,BAR_END,10,G15_COLOR_BLACK,b_user+1,b_total,4);
+ g15r_drawBar(canvas,BAR_START,12,BAR_END,21,G15_COLOR_BLACK,b_sys+1,b_total,4);
+ g15r_drawBar(canvas,BAR_START,23,BAR_END,32,G15_COLOR_BLACK,b_nice+1,b_total,4);
+ drawBar_reversed(canvas,BAR_START,1,BAR_END,32,G15_COLOR_BLACK,b_idle+1,b_total,5);
- g15r_drawLine (canvas, 40, 1, 40, 32, 1);
- g15r_drawLine (canvas, 41, 1, 41, 32, 1);
+ g15r_drawLine (canvas, VL_LEFT, 1, VL_LEFT, 32, G15_COLOR_BLACK);
+ g15r_drawLine (canvas, VL_LEFT+1, 1, VL_LEFT+1, 32, G15_COLOR_BLACK);
- g15r_renderString (canvas, (unsigned char*)"I", 0, G15_TEXT_MED, 152, 4);
- g15r_renderString (canvas, (unsigned char*)"d", 1, G15_TEXT_MED, 152, 4);
- g15r_renderString (canvas, (unsigned char*)"l", 2, G15_TEXT_MED, 152, 4);
- g15r_renderString (canvas, (unsigned char*)"e", 3, G15_TEXT_MED, 152, 4);
+ g15r_renderString (canvas, (unsigned char*)"I", 0, G15_TEXT_MED, TEXT_RIGHT, 4);
+ g15r_renderString (canvas, (unsigned char*)"d", 1, G15_TEXT_MED, TEXT_RIGHT, 4);
+ g15r_renderString (canvas, (unsigned char*)"l", 2, G15_TEXT_MED, TEXT_RIGHT, 4);
+ g15r_renderString (canvas, (unsigned char*)"e", 3, G15_TEXT_MED, TEXT_RIGHT, 4);
// sprintf(tmpstr,"IOWait %u, Interrupts/s %u",b_iowait, b_irq);
float minutes = uptime.uptime/60;
@@ -316,15 +316,15 @@
for(i=net_rr_index+1;i<MAX_NET_HIST;i++) {
diff = (float) net_max_in / (float) net_hist[i][0];
height = 16-(16/diff);
- g15r_setPixel(canvas,x,height,1);
- g15r_drawLine(canvas,x,height,x-1,last,1);
+ g15r_setPixel(canvas,x,height,G15_COLOR_BLACK);
+ g15r_drawLine(canvas,x,height,x-1,last,G15_COLOR_BLACK);
last=height;
x++;
}
for(i=0;i<net_rr_index;i++) {
diff = (float) net_max_in / (float) net_hist[i][0];
height = 16-(16 / diff);
- g15r_drawLine(canvas,x,height,x-1,last,1);
+ g15r_drawLine(canvas,x,height,x-1,last,G15_COLOR_BLACK);
last=height;
x++;
}
@@ -333,21 +333,21 @@
for(i=net_rr_index+1;i<MAX_NET_HIST;i++) {
diff = (float) net_max_out / (float) net_hist[i][1];
height = 34-(16/diff);
- g15r_setPixel(canvas,x,height,1);
- g15r_drawLine(canvas,x,height,x-1,last,1);
+ g15r_setPixel(canvas,x,height,G15_COLOR_BLACK);
+ g15r_drawLine(canvas,x,height,x-1,last,G15_COLOR_BLACK);
last=height;
x++;
}
for(i=0;i<net_rr_index;i++) {
diff = (float) net_max_out / (float) net_hist[i][1];
height = 34-(16 / diff);
- g15r_drawLine(canvas,x,height,x-1,last,1);
+ g15r_drawLine(canvas,x,height,x-1,last,G15_COLOR_BLACK);
last=height;
x++;
}
- g15r_drawLine (canvas, 52, 0, 52, 34, 1);
- g15r_drawLine (canvas, 53, 0, 53, 34, 1);
- g15r_drawLine (canvas, 54, 0, 54, 34, 1);
+ g15r_drawLine (canvas, 52, 0, 52, 34, G15_COLOR_BLACK);
+ g15r_drawLine (canvas, 53, 0, 53, 34, G15_COLOR_BLACK);
+ g15r_drawLine (canvas, 54, 0, 54, 34, G15_COLOR_BLACK);
sprintf(tmpstr,"IN %s",show_bytes(netload.bytes_in));
g15r_renderString (canvas, (unsigned char*)tmpstr, 0, G15_TEXT_MED, 1, 2);
@@ -365,6 +365,147 @@
}
+void draw_bat_screen(g15canvas *canvas) {
+
+ g15_stats_bat_info bats[NUM_BATS];
+ long tot_max_charge = 0;
+ long tot_cur_charge = 0;
+
+ FILE *fd_state;
+ FILE *fd_info;
+ char line [MAX_LINES];
+ char value [MAX_LINES];
+ char tmpstr [MAX_LINES];
+
+ int i = 0;
+ for (i = 0; i < NUM_BATS; i++)
+ {
+ char filename[30];
+
+ // Initialize battery state
+ bats[i].max_charge = 0;
+ bats[i].cur_charge = 0;
+ bats[i].status = -1;
+
+ sprintf(filename, "/proc/acpi/battery/BAT%d/state", i);
+ fd_state=fopen (filename,"r");
+ if (fd_state!=NULL)
+ {
+ while (fgets (line,MAX_LINES,fd_state)!=NULL)
+ {
+ // Parse the state file for battery info
+ if (strcasestr (line,"remaining capacity")!=0)
+ {
+ strncpy ((char *)value,((char *)line)+25,5);
+ bats[i].cur_charge=atoi (value);
+ }
+ if (strcasestr (line,"charging state")!=0)
+ {
+ if (strcasestr (line,"charged")!=0)
+ {
+ bats[i].status=0;
+ }
+ if (strcasestr (line," charging")!=0)
+ {
+ bats[i].status=1;
+ }
+ if (strcasestr (line,"discharging")!=0)
+ {
+ bats[i].status=2;
+ }
+ }
+ }
+ fclose (fd_state);
+ sprintf(filename, "/proc/acpi/battery/bat%d/info", i);
+ fd_info=fopen (filename,"r");
+
+ if (fd_info!=NULL)
+ {
+ while (fgets (line,MAX_LINES,fd_info)!=NULL)
+ {
+ // Parse the info file for battery info
+ if (strcasestr (line,"last full capacity")!=0)
+ {
+ strncpy ((char *)value,((char *)line)+25,5);
+ bats[i].max_charge=atoi (value);
+ }
+ }
+ fclose (fd_info);
+ }
+
+ tot_cur_charge += bats[i].cur_charge;
+ tot_max_charge += bats[i].max_charge;
+
+ }
+ }
+
+ g15r_clearScreen (canvas, G15_COLOR_WHITE);
+
+ g15r_renderString (canvas, (unsigned char*)"F", 0, G15_TEXT_MED, 155, 4);
+ g15r_renderString (canvas, (unsigned char*)"U", 1, G15_TEXT_MED, 155, 4);
+ g15r_renderString (canvas, (unsigned char*)"L", 2, G15_TEXT_MED, 155, 4);
+ g15r_renderString (canvas, (unsigned char*)"L", 3, G15_TEXT_MED, 155, 4);
+
+ g15r_drawLine (canvas, VL_LEFT, 1, VL_LEFT, 32, G15_COLOR_BLACK);
+ g15r_drawLine (canvas, VL_LEFT+1, 1, VL_LEFT+1, 32, G15_COLOR_BLACK);
+
+ for (i = 0; i < NUM_BATS; i++)
+ {
+ register float charge = 0;
+ register int bar_top = (i*10) + 1 + i;
+ register int bar_bottom = ((i+1)*10) + i;
+ if (bats[i].max_charge > 0)
+ {
+ charge = ((float)bats[i].cur_charge/(float)bats[i].max_charge)*100;
+ }
+ sprintf(tmpstr,"Bt%d %2.f%%", i, charge);
+ g15r_renderString (canvas, (unsigned char*)tmpstr, 0, G15_TEXT_MED, 1, (i*12) + 2);
+ g15r_drawBar(canvas, BAR_START, bar_top, BAR_END, bar_bottom, G15_COLOR_BLACK, bats[i].cur_charge, bats[i].max_charge, 4);
+ }
+
+ drawBar_reversed(canvas,BAR_START,1,BAR_END,32,G15_COLOR_BLACK,100-(((float)tot_cur_charge/(float)tot_max_charge)*100),100,5);
+
+ float total_charge = 0;
+ if (tot_max_charge > 0)
+ {
+ total_charge = ((float)tot_cur_charge/(float)tot_max_charge)*100;
+ }
+ sprintf (tmpstr,"Total %2.f%% | ", total_charge);
+
+ for (i = 0; i < NUM_BATS; i++)
+ {
+ char extension[11];
+ switch (bats[i].status)
+ {
+ case -1:
+ {
+ sprintf(extension, "Bt%d - | ", i);
+ break;
+ }
+ case 0:
+ {
+ sprintf(extension, "Bt%d F | ", i);
+ break;
+ }
+ case 1:
+ {
+ sprintf(extension, "Bt%d C | ", i);
+ break;
+ }
+ case 2:
+ {
+ sprintf(extension, "Bt%d D | ", i);
+ break;
+ }
+ }
+
+ strcat (tmpstr, extension);
+ }
+
+ g15r_renderString (canvas, (unsigned char*)tmpstr, 0, G15_TEXT_SMALL, 80-(strlen(tmpstr)*4)/2, 36);
+}
+
+
void keyboard_watch(void) {
unsigned int keystate;
@@ -374,17 +515,27 @@
if(keystate & G15_KEY_L1) {
}
else if(keystate & G15_KEY_L2) {
- cycle=0;
+ cycle--;
}
else if(keystate & G15_KEY_L3) {
- cycle=1;
+ cycle++;
}
else if(keystate & G15_KEY_L4) {
- cycle=2;
+ // These can now be passed to the "app" running
}
else if(keystate & G15_KEY_L5) {
- cycle=3;
+ // These can now be passed to the "app" running
}
+ if (cycle<0)
+ {
+ // Wrap around the apps
+ cycle=MAX_SCREENS;
+ }
+ if (cycle>MAX_SCREENS)
+ {
+ //Wrap around the apps
+ cycle=0;
+ }
usleep(100*900);
}
@@ -508,6 +659,9 @@
cycle=0;
}
break;
+ case 4:
+ draw_bat_screen(canvas);
+ break;
default:
printf("cycle reched %i\n",cycle);
}
Added: trunk/g15daemon-clients/g15stats/g15stats.h
===================================================================
--- trunk/g15daemon-clients/g15stats/g15stats.h (rev 0)
+++ trunk/g15daemon-clients/g15stats/g15stats.h 2009-01-03 05:34:51 UTC (rev 464)
@@ -0,0 +1,17 @@
+#define TEXT_LEFT 1
+#define NUM_BATS 3
+#define MAX_SCREENS 4
+#define VL_LEFT 42
+#define BAR_START 45
+#define MAX_NET_HIST 107
+#define BAR_END 153
+#define TEXT_RIGHT 155
+#define MAX_LINES 1024
+
+typedef struct g15_stats_bat_info
+{
+ long max_charge;
+ long cur_charge;
+ long status;
+} g15_stats_bat_info;
+
Property changes on: trunk/g15daemon-clients/g15stats/g15stats.h
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ane...@us...> - 2008-07-26 23:43:30
|
Revision: 463
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=463&view=rev
Author: aneurysm9
Date: 2008-07-26 23:43:34 +0000 (Sat, 26 Jul 2008)
Log Message:
-----------
Reorder clock border rendering to work around changes in libg15render text rendering
Modified Paths:
--------------
trunk/g15daemon-wip/libg15daemon_client/g15daemon_net.c
trunk/g15daemon-wip/plugins/g15_plugin_clock.c
Modified: trunk/g15daemon-wip/libg15daemon_client/g15daemon_net.c
===================================================================
--- trunk/g15daemon-wip/libg15daemon_client/g15daemon_net.c 2008-07-19 15:23:36 UTC (rev 462)
+++ trunk/g15daemon-wip/libg15daemon_client/g15daemon_net.c 2008-07-26 23:43:34 UTC (rev 463)
@@ -217,7 +217,7 @@
if(poll(pfd,1,100)>0){
if(pfd[0].revents & POLLPRI && !(pfd[0].revents & POLLERR || pfd[0].revents & POLLHUP || pfd[0].revents & POLLNVAL)) {
memset(packet,0,sizeof(packet));
- msgret = recv(sock, packet, 10 , MSG_OOB);
+ msgret = recv(sock, packet, sizeof(packet), MSG_OOB);
if (msgret < 1) {
return -1;
}
Modified: trunk/g15daemon-wip/plugins/g15_plugin_clock.c
===================================================================
--- trunk/g15daemon-wip/plugins/g15_plugin_clock.c 2008-07-19 15:23:36 UTC (rev 462)
+++ trunk/g15daemon-wip/plugins/g15_plugin_clock.c 2008-07-26 23:43:34 UTC (rev 463)
@@ -92,8 +92,6 @@
int i;
g15r_clearScreen (c, G15_COLOR_WHITE);
- g15r_drawCircle(c, CLOCK_CENTERX, CLOCK_CENTERY, CLOCK_RADIUS, 0, G15_COLOR_BLACK);
- g15r_drawCircle(c, CLOCK_CENTERX, CLOCK_CENTERY, 2, 1, G15_COLOR_BLACK);
for (i=0; i<60; i+=5)
{
@@ -131,6 +129,9 @@
g15r_setPixel(c, x1+dir, y1+dir, G15_COLOR_BLACK);
}
}
+
+ g15r_drawCircle(c, CLOCK_CENTERX, CLOCK_CENTERY, CLOCK_RADIUS, 0, G15_COLOR_BLACK);
+ g15r_drawCircle(c, CLOCK_CENTERX, CLOCK_CENTERY, 2, 1, G15_COLOR_BLACK);
}
static int draw_digital(g15canvas *canvas)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rob...@us...> - 2008-07-19 15:24:04
|
Revision: 462
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=462&view=rev
Author: robynhub
Date: 2008-07-19 15:23:36 +0000 (Sat, 19 Jul 2008)
Log Message:
-----------
Improved GUI
Modified Paths:
--------------
trunk/g15daemon-audio-plugins/g15daemon_audacious/AUTHORS
trunk/g15daemon-audio-plugins/g15daemon_audacious/README
trunk/g15daemon-audio-plugins/g15daemon_audacious/g15daemon_audacious_spectrum.c
Modified: trunk/g15daemon-audio-plugins/g15daemon_audacious/AUTHORS
===================================================================
--- trunk/g15daemon-audio-plugins/g15daemon_audacious/AUTHORS 2008-05-24 12:57:49 UTC (rev 461)
+++ trunk/g15daemon-audio-plugins/g15daemon_audacious/AUTHORS 2008-07-19 15:23:36 UTC (rev 462)
@@ -1,2 +1,3 @@
+Antonio Bartolini <rob...@gm...>
Anthony J. Mirabella <mir...@gm...>
Based on (ok, mostly shamelessly copied from) the g15daemon_xmms plugin by Mike Lampard
Modified: trunk/g15daemon-audio-plugins/g15daemon_audacious/README
===================================================================
--- trunk/g15daemon-audio-plugins/g15daemon_audacious/README 2008-05-24 12:57:49 UTC (rev 461)
+++ trunk/g15daemon-audio-plugins/g15daemon_audacious/README 2008-07-19 15:23:36 UTC (rev 462)
@@ -32,3 +32,5 @@
- Show time in progress bar
New in version 2.5.5
- Added Line mode
+New in version 2.5.6
+- Improved gui
Modified: trunk/g15daemon-audio-plugins/g15daemon_audacious/g15daemon_audacious_spectrum.c
===================================================================
--- trunk/g15daemon-audio-plugins/g15daemon_audacious/g15daemon_audacious_spectrum.c 2008-05-24 12:57:49 UTC (rev 461)
+++ trunk/g15daemon-audio-plugins/g15daemon_audacious/g15daemon_audacious_spectrum.c 2008-07-19 15:23:36 UTC (rev 462)
@@ -70,7 +70,7 @@
/* Some useful costants */
#define WIDTH 256
-#define PLUGIN_VERSION "2.5.5"
+#define PLUGIN_VERSION "2.5.6"
#define PLUGIN_NAME "G15daemon Visualization Plugin"
#define INFERIOR_SPACE 7 /* space between bars and position bar */
#define SUPERIOR_SPACE 7 /* space between bars and top of lcd */
@@ -203,7 +203,7 @@
/* gdk stuff */
static GtkWidget *configure_win = NULL;
-static GtkWidget *vbox;
+static GtkWidget *vbox, *hbox;
static GtkWidget *bbox, *ok, *cancel, *apply, *defaults;
static GtkWidget *t_options_bars_radio, *t_options_scope_radio;
static GtkWidget *t_options_effect_no, *t_options_effect_line, *t_options_effect_peak, *t_options_effect_analog;
@@ -520,13 +520,16 @@
gtk_window_set_policy(GTK_WINDOW(configure_win), FALSE, FALSE, FALSE);
gtk_window_set_position(GTK_WINDOW(configure_win), GTK_WIN_POS_MOUSE);
gtk_signal_connect(GTK_OBJECT(configure_win), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroyed), &configure_win);
-
+
vbox = gtk_vbox_new(FALSE, 5);
-
+ gtk_widget_show(vbox);
+ gtk_container_add(GTK_CONTAINER(configure_win), vbox);
+
/* general config */
g_options_frame = gtk_frame_new("General:");
gtk_container_set_border_width(GTK_CONTAINER(g_options_frame), 5);
+ gtk_widget_set_size_request (g_options_frame, 258, -1);
t_options_vistype = gtk_vbox_new(FALSE, 5);
label = gtk_label_new("Visualization Type:");
gtk_misc_set_alignment(GTK_MISC (label), 0, 0);
@@ -594,10 +597,16 @@
gtk_widget_show(g_options_frame);
+ hbox = gtk_hbox_new(FALSE, 5);
+ gtk_widget_show(hbox);
+ //gtk_container_add(GTK_BOX (vbox), hbox);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
+
/* bars config */
g_options_frame_bars = gtk_frame_new("Spectrum bars options:");
gtk_container_set_border_width(GTK_CONTAINER(g_options_frame), 5);
+ //gtk_widget_set_size_request (g_options_frame_bars, 258, 258);
t_options_bars = gtk_vbox_new(FALSE, 5);
/* number of the bars */
label_bars=gtk_label_new("Num Bars:");
@@ -641,13 +650,14 @@
/* draw frame */
gtk_container_add(GTK_CONTAINER(g_options_frame_bars), t_options_bars);
gtk_widget_show(t_options_bars);
- gtk_box_pack_start(GTK_BOX(vbox), g_options_frame_bars, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), g_options_frame_bars, TRUE, TRUE, 0);
gtk_widget_show(g_options_frame_bars);
/* bars effects */
g_options_frame_bars_effects = gtk_frame_new("Spectrum bars effects:");
gtk_container_set_border_width(GTK_CONTAINER(g_options_frame_bars_effects), 5);
+ //gtk_widget_set_size_request (g_options_frame_bars_effects, 258, 268);
t_options_bars_effects = gtk_vbox_new(FALSE, 5);
/* radio effect type */
t_options_effect_no = gtk_radio_button_new_with_label(NULL, "None");
@@ -694,7 +704,7 @@
/* draw frame */
gtk_container_add(GTK_CONTAINER(g_options_frame_bars_effects), t_options_bars_effects);
gtk_widget_show(t_options_bars_effects);
- gtk_box_pack_start(GTK_BOX(vbox), g_options_frame_bars_effects, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), g_options_frame_bars_effects, TRUE, TRUE, 0);
gtk_widget_show(g_options_frame_bars_effects);
@@ -704,34 +714,33 @@
gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5);
gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
- ok = gtk_button_new_with_label(" Ok ");
+ ok = gtk_button_new_from_stock ("gtk-save");
gtk_signal_connect(GTK_OBJECT(ok), "clicked", GTK_SIGNAL_FUNC(g15analyser_conf_ok), NULL);
GTK_WIDGET_SET_FLAGS(ok, GTK_CAN_DEFAULT);
gtk_box_pack_start(GTK_BOX(bbox), ok, TRUE, TRUE, 0);
gtk_widget_show(ok);
- apply = gtk_button_new_with_label(" Apply ");
+ apply = gtk_button_new_from_stock ("gtk-apply");
gtk_signal_connect(GTK_OBJECT(apply), "clicked", GTK_SIGNAL_FUNC(g15analyser_conf_apply), NULL);
GTK_WIDGET_SET_FLAGS(apply, GTK_CAN_DEFAULT);
gtk_box_pack_start(GTK_BOX(bbox), apply, TRUE, TRUE, 0);
gtk_widget_show(apply);
- defaults = gtk_button_new_with_label(" Reset ");
+ defaults = gtk_button_new_from_stock ("gtk-revert-to-saved");
gtk_signal_connect(GTK_OBJECT(defaults), "clicked", GTK_SIGNAL_FUNC(g15analyser_conf_reset_defaults_gui), NULL);
GTK_WIDGET_SET_FLAGS(defaults, GTK_CAN_DEFAULT);
gtk_box_pack_start(GTK_BOX(bbox), defaults, TRUE, TRUE, 0);
gtk_widget_show(defaults);
- cancel = gtk_button_new_with_label("Cancel");
+ cancel = gtk_button_new_from_stock ("gtk-cancel");
gtk_signal_connect_object(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(g15analyser_conf_cancel), GTK_OBJECT(configure_win));
GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT);
gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0);
- gtk_container_add(GTK_CONTAINER(configure_win), vbox);
/* Show all */
gtk_widget_show(cancel);
gtk_widget_show(bbox);
- gtk_widget_show(vbox);
+
gtk_widget_show(configure_win);
return;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rob...@us...> - 2008-05-24 12:57:45
|
Revision: 461
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=461&view=rev
Author: robynhub
Date: 2008-05-24 05:57:49 -0700 (Sat, 24 May 2008)
Log Message:
-----------
moved version
Modified Paths:
--------------
trunk/g15daemon-audio-plugins/g15daemon_audacious/configure.in
Modified: trunk/g15daemon-audio-plugins/g15daemon_audacious/configure.in
===================================================================
--- trunk/g15daemon-audio-plugins/g15daemon_audacious/configure.in 2008-05-24 12:53:13 UTC (rev 460)
+++ trunk/g15daemon-audio-plugins/g15daemon_audacious/configure.in 2008-05-24 12:57:49 UTC (rev 461)
@@ -2,8 +2,8 @@
# Process this file with autoconf to produce a configure script.
# $Revision: 157 $ - $Date: 2006-11-15 23:12:39 -0500 (Wed, 15 Nov 2006) $ $Author: aneurysm9 $
PACKAGE=g15daemon-audacious
-VERSION=2.5.2
-AC_INIT(g15daemon-audacious,2.5.2, [rob...@us...])
+VERSION=2.5.5
+AC_INIT(g15daemon-audacious,2.5.5, [rob...@us...])
AC_PREREQ(2.59)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rob...@us...> - 2008-05-24 12:53:13
|
Revision: 460
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=460&view=rev
Author: robynhub
Date: 2008-05-24 05:53:13 -0700 (Sat, 24 May 2008)
Log Message:
-----------
Added Line Mode and bugfixes
Modified Paths:
--------------
trunk/g15daemon-audio-plugins/g15daemon_audacious/README
trunk/g15daemon-audio-plugins/g15daemon_audacious/g15daemon_audacious_spectrum.c
Modified: trunk/g15daemon-audio-plugins/g15daemon_audacious/README
===================================================================
--- trunk/g15daemon-audio-plugins/g15daemon_audacious/README 2008-02-09 14:36:30 UTC (rev 459)
+++ trunk/g15daemon-audio-plugins/g15daemon_audacious/README 2008-05-24 12:53:13 UTC (rev 460)
@@ -30,3 +30,5 @@
- Added support for Audacious 1.4
New in version 2.5.4
- Show time in progress bar
+New in version 2.5.5
+- Added Line mode
Modified: trunk/g15daemon-audio-plugins/g15daemon_audacious/g15daemon_audacious_spectrum.c
===================================================================
--- trunk/g15daemon-audio-plugins/g15daemon_audacious/g15daemon_audacious_spectrum.c 2008-02-09 14:36:30 UTC (rev 459)
+++ trunk/g15daemon-audio-plugins/g15daemon_audacious/g15daemon_audacious_spectrum.c 2008-05-24 12:53:13 UTC (rev 460)
@@ -1,3 +1,4 @@
+
/*
This file is part of g15daemon.
@@ -69,7 +70,7 @@
/* Some useful costants */
#define WIDTH 256
-#define PLUGIN_VERSION "2.5.4"
+#define PLUGIN_VERSION "2.5.5"
#define PLUGIN_NAME "G15daemon Visualization Plugin"
#define INFERIOR_SPACE 7 /* space between bars and position bar */
#define SUPERIOR_SPACE 7 /* space between bars and top of lcd */
@@ -116,6 +117,9 @@
/* Boolean. Enable Analog Mode */
static unsigned int analog_mode;
+/* Boolean. Enable Line Mode */
+static unsigned int line_mode;
+
/* Integer. Step for leds in Analog Mode. Min value: 2 */
static unsigned int analog_step;
@@ -146,6 +150,7 @@
static unsigned int def_enable_peak = TRUE;
static unsigned int def_detached_peak = TRUE;
static unsigned int def_analog_mode = FALSE;
+static unsigned int def_line_mode = FALSE;
static unsigned int def_analog_step = 2;
static unsigned int def_enable_keybindings = FALSE;
static unsigned int def_show_title = TRUE;
@@ -201,7 +206,7 @@
static GtkWidget *vbox;
static GtkWidget *bbox, *ok, *cancel, *apply, *defaults;
static GtkWidget *t_options_bars_radio, *t_options_scope_radio;
-static GtkWidget *t_options_effect_no, *t_options_effect_peak, *t_options_effect_analog;
+static GtkWidget *t_options_effect_no, *t_options_effect_line, *t_options_effect_peak, *t_options_effect_analog;
static GtkWidget *t_options_vistype;
static GtkWidget *t_options_bars, *t_options_bars_effects;
static GtkWidget *g_options_frame ,*g_options_enable_keybindings, *g_options_enable_dpeak;
@@ -214,7 +219,6 @@
static gint tmp_bars=-1, tmp_step=-1, tmp_ampli=-1000, tmp_rownum=-1;
static gfloat tmp_lin=-1;
-
VisPlugin g15analyser_vp = {
#ifdef OLD_PLUGIN
@@ -294,6 +298,7 @@
bmp_cfg_db_get_int(cfg, "G15Daemon Spectrum", "num_bars", (int*)&num_bars);
bmp_cfg_db_get_int(cfg, "G15Daemon Spectrum", "enable_peak", (int*)&enable_peak);
bmp_cfg_db_get_int(cfg, "G15Daemon Spectrum", "detached_peak", (int*)&detached_peak);
+ bmp_cfg_db_get_int(cfg, "G15Daemon Spectrum", "line_mode", (int*)&line_mode);
bmp_cfg_db_get_int(cfg, "G15Daemon Spectrum", "analog_mode", (int*)&analog_mode);
bmp_cfg_db_get_int(cfg, "G15Daemon Spectrum", "analog_step", (int*)&analog_step);
bmp_cfg_db_get_int(cfg, "G15Daemon Spectrum", "enable_keybindings", (int*)&enable_keybindings);
@@ -327,6 +332,8 @@
detached_peak = def_detached_peak;
if (analog_mode != FALSE && analog_mode != TRUE)
analog_mode = def_analog_mode;
+ if (line_mode != FALSE && line_mode != TRUE)
+ line_mode = def_line_mode;
if (show_title != FALSE && show_title != TRUE)
show_title = def_show_title;
if (show_pbar != FALSE && show_pbar != TRUE)
@@ -356,6 +363,7 @@
bmp_cfg_db_set_int(cfg, "G15Daemon Spectrum", "enable_peak", enable_peak);
bmp_cfg_db_set_int(cfg, "G15Daemon Spectrum", "detached_peak", detached_peak);
bmp_cfg_db_set_int(cfg, "G15Daemon Spectrum", "analog_mode", analog_mode);
+ bmp_cfg_db_set_int(cfg, "G15Daemon Spectrum", "line_mode", line_mode);
bmp_cfg_db_set_int(cfg, "G15Daemon Spectrum", "analog_step", analog_step);
bmp_cfg_db_set_int(cfg, "G15Daemon Spectrum", "enable_keybindings", enable_keybindings);
bmp_cfg_db_set_int(cfg, "G15Daemon Spectrum", "show_title", show_title);
@@ -388,9 +396,11 @@
if (GTK_TOGGLE_BUTTON(t_options_effect_no)->active){
enable_peak = 0;
analog_mode = 0;
+ line_mode = 0;
} else {
enable_peak = GTK_TOGGLE_BUTTON(t_options_effect_peak)->active;
analog_mode = GTK_TOGGLE_BUTTON(t_options_effect_analog)->active;
+ line_mode = GTK_TOGGLE_BUTTON(t_options_effect_line)->active;
}
detached_peak = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(g_options_enable_dpeak));
enable_keybindings = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(g_options_enable_keybindings));
@@ -413,6 +423,7 @@
limit = def_limit;
enable_peak = def_enable_peak;
detached_peak = def_detached_peak;
+ line_mode = def_line_mode;
analog_mode = def_analog_mode;
analog_step = def_analog_step;
enable_keybindings = def_enable_keybindings;
@@ -443,9 +454,10 @@
tmp_rownum = def_rownum;
gtk_adjustment_set_value((GtkAdjustment *)adj_rownum,tmp_rownum);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(t_options_effect_no), !def_enable_peak && !def_analog_mode);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(t_options_effect_peak), def_enable_peak && !def_analog_mode);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(t_options_effect_analog),!def_enable_peak && def_analog_mode);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(t_options_effect_no), !def_enable_peak && !def_analog_mode && !def_line_mode);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(t_options_effect_line), !def_enable_peak && !def_analog_mode && def_line_mode);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(t_options_effect_peak), def_enable_peak && !def_analog_mode && !def_line_mode);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(t_options_effect_analog),!def_enable_peak && def_analog_mode && !def_line_mode);
tmp_step = def_analog_step;
@@ -638,19 +650,24 @@
gtk_container_set_border_width(GTK_CONTAINER(g_options_frame_bars_effects), 5);
t_options_bars_effects = gtk_vbox_new(FALSE, 5);
/* radio effect type */
- t_options_effect_no = gtk_radio_button_new_with_label(NULL, "None");
- t_options_effect_peak = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(t_options_effect_no)), "Peaks");
+ t_options_effect_no = gtk_radio_button_new_with_label(NULL, "None");
+ t_options_effect_line = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(t_options_effect_no)), "Line");
+ t_options_effect_peak = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(t_options_effect_line)), "Peaks");
t_options_effect_analog = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(t_options_effect_peak)), "Analog");
/* no effect radio */
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(t_options_effect_no), (enable_peak == FALSE && analog_mode == FALSE));
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(t_options_effect_no), (enable_peak == FALSE && analog_mode == FALSE && line_mode == FALSE));
gtk_box_pack_start(GTK_BOX(t_options_bars_effects), t_options_effect_no, FALSE, FALSE, 0);
gtk_widget_show(t_options_effect_no);
+ /* line effect radio */
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(t_options_effect_line), (enable_peak == FALSE && analog_mode == FALSE && line_mode == TRUE));
+ gtk_box_pack_start(GTK_BOX(t_options_bars_effects), t_options_effect_line, FALSE, FALSE, 0);
+ gtk_widget_show(t_options_effect_line);
/* peak effect radio */
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(t_options_effect_peak), (enable_peak == TRUE && analog_mode == FALSE));
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(t_options_effect_peak), (enable_peak == TRUE && analog_mode == FALSE && line_mode == FALSE));
gtk_box_pack_start(GTK_BOX(t_options_bars_effects), t_options_effect_peak, FALSE, FALSE, 0);
gtk_widget_show(t_options_effect_peak);
/* analog effect radio */
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(t_options_effect_analog), (enable_peak == FALSE && analog_mode == TRUE));
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(t_options_effect_analog), (enable_peak == FALSE && analog_mode == TRUE && line_mode == FALSE));
gtk_box_pack_start(GTK_BOX(t_options_bars_effects), t_options_effect_analog, FALSE, FALSE, 0);
gtk_widget_show(t_options_effect_analog);
@@ -731,15 +748,15 @@
/* Something about us... */
label = gtk_label_new (PLUGIN_NAME"\n\
- v. " PLUGIN_VERSION "\n\
- \n\
- by Mike Lampard <mla...@us...>\n\
- Anthony J. Mirabella <aneurysm9>\n\
- Antonio Bartolini <rob...@us...>\n\
- and others...\n\
- \n\
- get the newest version from:\n\
- http://g15daemon.sf.net/\n\
+ v. " PLUGIN_VERSION "\n \
+ \n \
+ by Mike Lampard <mla...@us...>\n \
+ Anthony J. Mirabella <aneurysm9>\n \
+ Antonio Bartolini <rob...@us...>\n \
+ and others...\n \
+ \n \
+ get the newest version from:\n \
+ http://g15daemon.sf.net/\n \
");
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), label, FALSE, FALSE, 0);
@@ -864,7 +881,7 @@
#ifdef OLD_PLUGIN
xmms_remote_playlist_next(g15analyser_vp.xmms_session);
#else
- audacious_drct_playlist_next();
+ audacious_drct_playlist_next();
#endif
if(event.xkey.keycode==XKeysymToKeycode(dpy, XF86XK_AudioPrev))
@@ -872,7 +889,7 @@
#ifdef OLD_PLUGIN
xmms_remote_playlist_prev(g15analyser_vp.xmms_session);
#else
- audacious_drct_playlist_prev();
+ audacious_drct_playlist_prev();
#endif
}
return TRUE;
@@ -891,14 +908,14 @@
pthread_mutex_lock (&g15buf_mutex);
g15r_clearScreen (canvas, G15_COLOR_WHITE);
-
+
#ifdef OLD_PLUGIN
if (xmms_remote_get_playlist_length(g15analyser_vp.xmms_session) > 0){
- playlist_pos = xmms_remote_get_playlist_pos(g15analyser_vp.xmms_session);
-
- title = xmms_remote_get_playlist_title(g15analyser_vp.xmms_session, playlist_pos);
+ playlist_pos = xmms_remote_get_playlist_pos(g15analyser_vp.xmms_session);
+
+ title = xmms_remote_get_playlist_title(g15analyser_vp.xmms_session, playlist_pos);
#else
- if (audacious_drct_get_playlist_length() > 0){
+ if (audacious_drct_get_playlist_length() > 0){
playlist_pos = audacious_drct_get_playlist_pos();
title = audacious_drct_get_playlist_title(playlist_pos);
#endif
@@ -1005,7 +1022,7 @@
int output_time = audacious_drct_get_output_time()/1000;
int playlist_time = audacious_drct_get_playlist_time(playlist_pos)/1000;
#endif
-
+
/* bugfix: Sometimes xmms don't get the output time */
if (playlist_time == 0){
playlist_time = 1000;
@@ -1048,7 +1065,7 @@
if (y1 > limit - 2) /* check new limit for bars to show peaks even when max */
y1 = limit - 2;
/* check for new peak */
- if(y1 >= bar_heights_peak[i]) {
+ if(y1 > bar_heights_peak[i]) {
bar_heights_peak[i] = y1;
} else
/* decrement old peak */
@@ -1058,25 +1075,32 @@
y1 = bottom_line - y1; /* always show bottom of the bars */
/* Analog Mode */
- if (analog_mode){
+ if (analog_mode && ! line_mode){
int end = y1 + analog_step - (y1 % analog_step) - 1; /* superior approx to multiple */
for(j = bottom_line ; j >= end; j-= analog_step){
/* draw leds :-) */
g15r_pixelBox (canvas, i, j - analog_step + 2 ,i + bar_width - 2, j , G15_COLOR_BLACK, 1, 1);
}
- } else
- g15r_pixelBox (canvas, i, y1 , i + bar_width - 2, bottom_line, G15_COLOR_BLACK, 1, 1);
-
+ } else {
+ /* line mode */
+ if (line_mode)
+ g15r_drawLine (canvas, i, y1 , i + bar_width - 1, y1, G15_COLOR_BLACK);
+ else
+ g15r_pixelBox (canvas, i, y1 , i + bar_width - 2, bottom_line, G15_COLOR_BLACK, 1, 1);
+
+ }
/* Enable peak*/
- if (enable_peak && ! analog_mode){
+ if (enable_peak && ! analog_mode && ! line_mode){
int peak;
/* superior limit */
if (bar_heights_peak[i] < limit){
peak = bottom_line - bar_heights_peak[i] - detached_peak*2; /* height of peak */
+
/* inferior limit */
if ( bar_heights_peak[i] > 0)
g15r_pixelBox (canvas, i, peak , i + bar_width - 2, peak, G15_COLOR_BLACK, 1, 1);
}
+
}
}
}
@@ -1096,226 +1120,226 @@
g15r_renderString (canvas, (unsigned char *)"Playback Stopped", 0, G15_TEXT_LARGE, 16, 16);
}
- else
- g15r_renderString (canvas, (unsigned char *)"Playlist Empty", 0, G15_TEXT_LARGE, 24, 16);
-
- if(lastvolume!=get_main_volume() || vol_timeout>=0) {
- if(lastvolume!=get_main_volume())
- vol_timeout=10;
else
- vol_timeout--;
- /* render volume */
- lastvolume = get_main_volume();
- if (lastvolume >= 0)
- g15r_drawBar (canvas, 10, 15, 149, 28, G15_COLOR_BLACK, lastvolume, 100, 1);
- canvas->mode_xor=1;
- g15r_renderString (canvas, (unsigned char *)"Volume", 0, G15_TEXT_LARGE, 59, 18);
- canvas->mode_xor=0;
- }
- /* do a quicky checksum - only send frame if different */
- for(i=0;i<G15_BUFFER_LEN;i++){
- chksum+=canvas->buffer[i]*i;
- }
- if(last_chksum!=chksum) {
- if(g15_send(g15screen_fd,(char *)canvas->buffer,G15_BUFFER_LEN)<0) {
- perror("lost connection, tryng again\n");
- /* connection error occurred - try to reconnect to the daemon */
- g15screen_fd=new_g15_screen(G15_G15RBUF);
+ g15r_renderString (canvas, (unsigned char *)"Playlist Empty", 0, G15_TEXT_LARGE, 24, 16);
+
+ if(lastvolume!=get_main_volume() || vol_timeout>=0) {
+ if(lastvolume!=get_main_volume())
+ vol_timeout=10;
+ else
+ vol_timeout--;
+ /* render volume */
+ lastvolume = get_main_volume();
+ if (lastvolume >= 0)
+ g15r_drawBar (canvas, 10, 15, 149, 28, G15_COLOR_BLACK, lastvolume, 100, 1);
+ canvas->mode_xor=1;
+ g15r_renderString (canvas, (unsigned char *)"Volume", 0, G15_TEXT_LARGE, 59, 18);
+ canvas->mode_xor=0;
}
+ /* do a quicky checksum - only send frame if different */
+ for(i=0;i<G15_BUFFER_LEN;i++){
+ chksum+=canvas->buffer[i]*i;
+ }
+ if(last_chksum!=chksum) {
+ if(g15_send(g15screen_fd,(char *)canvas->buffer,G15_BUFFER_LEN)<0) {
+ perror("lost connection, tryng again\n");
+ /* connection error occurred - try to reconnect to the daemon */
+ g15screen_fd=new_g15_screen(G15_G15RBUF);
+ }
+ }
+ last_chksum=chksum;
+
+ pthread_mutex_unlock(&g15buf_mutex);
+ return TRUE;
}
- last_chksum=chksum;
- pthread_mutex_unlock(&g15buf_mutex);
- return TRUE;
-}
-
-int myx_error_handler(Display *dpy, XErrorEvent *err){
+ int myx_error_handler(Display *dpy, XErrorEvent *err){
+
+ printf("error (%i) occured - ignoring\n",err->error_code);
+ return 0;
+ }
- printf("error (%i) occured - ignoring\n",err->error_code);
- return 0;
-}
-
-
-static void g15analyser_init(void) {
- pthread_mutex_init(&g15buf_mutex, NULL);
- g15analyser_conf_reset();
- g15spectrum_read_config();
-
- pthread_mutex_lock(&g15buf_mutex);
-
- if (enable_keybindings) {
- dpy = XOpenDisplay(getenv("DISPLAY"));
- if (!dpy) {
- printf("Can't open display\n");
- return;
+ static void g15analyser_init(void) {
+
+ pthread_mutex_init(&g15buf_mutex, NULL);
+ g15analyser_conf_reset();
+ g15spectrum_read_config();
+
+ pthread_mutex_lock(&g15buf_mutex);
+
+ if (enable_keybindings) {
+ dpy = XOpenDisplay(getenv("DISPLAY"));
+ if (!dpy) {
+ printf("Can't open display\n");
+ return;
+ }
+ root_win = DefaultRootWindow(dpy);
+ if (!root_win) {
+ printf("Cant find root window\n");
+ return;
+ }
+
+ /* completely ignore errors and carry on */
+ XSetErrorHandler(myx_error_handler);
+ XFlush(dpy);
+
+ XGrabKey(dpy,XKeysymToKeycode(dpy, XF86XK_AudioPlay), AnyModifier, root_win,
+ False, GrabModeAsync, GrabModeAsync);
+ XGrabKey(dpy,XKeysymToKeycode(dpy, XF86XK_AudioStop), AnyModifier, root_win,
+ False, GrabModeAsync, GrabModeAsync);
+ XGrabKey(dpy,XKeysymToKeycode(dpy, XF86XK_AudioPrev), AnyModifier, root_win,
+ False, GrabModeAsync, GrabModeAsync);
+ XGrabKey(dpy,XKeysymToKeycode(dpy, XF86XK_AudioNext), AnyModifier, root_win,
+ False, GrabModeAsync, GrabModeAsync);
+ XGrabKey(dpy,XKeysymToKeycode(dpy, XF86XK_AudioLowerVolume),Mod2Mask , root_win,
+ False, GrabModeAsync, GrabModeAsync);
+ XGrabKey(dpy,XKeysymToKeycode(dpy, XF86XK_AudioRaiseVolume), Mod2Mask, root_win,
+ False, GrabModeAsync, GrabModeAsync);
+ XGrabKey(dpy,XKeysymToKeycode(dpy, XF86XK_AudioMute), Mod2Mask, root_win,
+ False, GrabModeAsync, GrabModeAsync);
}
- root_win = DefaultRootWindow(dpy);
- if (!root_win) {
- printf("Cant find root window\n");
+
+ g15screen_fd = new_g15_screen(G15_G15RBUF);
+ if(g15screen_fd < 0 ){
+ printf("Cant connect with G15daemon !\n");
+ pthread_mutex_unlock(&g15buf_mutex);
+ gtk_idle_add (g15analyser_disable,NULL);
return;
}
+ canvas = (g15canvas *) malloc (sizeof (g15canvas));
+ if (canvas != NULL)
+ {
+ memset(canvas->buffer, 0, G15_BUFFER_LEN);
+ canvas->mode_cache = 0;
+ canvas->mode_reverse = 0;
+ canvas->mode_xor = 0;
+ }
- /* completely ignore errors and carry on */
- XSetErrorHandler(myx_error_handler);
- XFlush(dpy);
- XGrabKey(dpy,XKeysymToKeycode(dpy, XF86XK_AudioPlay), AnyModifier, root_win,
- False, GrabModeAsync, GrabModeAsync);
- XGrabKey(dpy,XKeysymToKeycode(dpy, XF86XK_AudioStop), AnyModifier, root_win,
- False, GrabModeAsync, GrabModeAsync);
- XGrabKey(dpy,XKeysymToKeycode(dpy, XF86XK_AudioPrev), AnyModifier, root_win,
- False, GrabModeAsync, GrabModeAsync);
- XGrabKey(dpy,XKeysymToKeycode(dpy, XF86XK_AudioNext), AnyModifier, root_win,
- False, GrabModeAsync, GrabModeAsync);
- XGrabKey(dpy,XKeysymToKeycode(dpy, XF86XK_AudioLowerVolume),Mod2Mask , root_win,
- False, GrabModeAsync, GrabModeAsync);
- XGrabKey(dpy,XKeysymToKeycode(dpy, XF86XK_AudioRaiseVolume), Mod2Mask, root_win,
- False, GrabModeAsync, GrabModeAsync);
- XGrabKey(dpy,XKeysymToKeycode(dpy, XF86XK_AudioMute), Mod2Mask, root_win,
- False, GrabModeAsync, GrabModeAsync);
+ pthread_mutex_unlock(&g15buf_mutex);
+ /* increase lcd drive voltage/contrast for this client */
+ g15_send_cmd(g15screen_fd, G15DAEMON_CONTRAST,2);
+
+ pthread_attr_t attr;
+ memset(&attr,0,sizeof(pthread_attr_t));
+ pthread_attr_init(&attr);
+ pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED);
+ if (enable_keybindings){
+ mmedia_timeout_handle = g_timeout_add(100, poll_mmediakeys, NULL);
+ g15keys_timeout_handle = g_timeout_add(100, poll_g15keys, NULL);
+ }
+ g15disp_timeout_handle = g_timeout_add(75, g15send_func, NULL);
+
}
- g15screen_fd = new_g15_screen(G15_G15RBUF);
- if(g15screen_fd < 0 ){
- printf("Cant connect with G15daemon !\n");
- pthread_mutex_unlock(&g15buf_mutex);
- gtk_idle_add (g15analyser_disable,NULL);
+ static void g15analyser_cleanup(void) {
+
+ pthread_mutex_lock (&g15buf_mutex);
+ /* Write down config */
+ g15spectrum_write_config();
+ if (canvas != NULL)
+ free(canvas);
+ if(g15screen_fd)
+ close(g15screen_fd);
+ pthread_mutex_unlock (&g15buf_mutex);
+ if (enable_keybindings){
+ XUngrabKey(dpy, XF86XK_AudioPrev, AnyModifier, root_win);
+ XUngrabKey(dpy, XF86XK_AudioNext, AnyModifier, root_win);
+ XUngrabKey(dpy, XF86XK_AudioPlay, AnyModifier, root_win);
+ XUngrabKey(dpy, XF86XK_AudioStop, AnyModifier, root_win);
+ XUngrabKey(dpy, XF86XK_AudioLowerVolume, Mod2Mask, root_win);
+ XUngrabKey(dpy, XF86XK_AudioRaiseVolume, Mod2Mask, root_win);
+ XUngrabKey(dpy, XF86XK_AudioMute, AnyModifier, root_win);
+
+ gtk_timeout_remove(mmedia_timeout_handle);
+ gtk_timeout_remove(g15keys_timeout_handle);
+ }
+ gtk_timeout_remove(g15disp_timeout_handle);
+ if (enable_keybindings)
+ XCloseDisplay(dpy);
+
return;
}
- canvas = (g15canvas *) malloc (sizeof (g15canvas));
- if (canvas != NULL)
- {
- memset(canvas->buffer, 0, G15_BUFFER_LEN);
- canvas->mode_cache = 0;
- canvas->mode_reverse = 0;
- canvas->mode_xor = 0;
- }
+ static void g15analyser_playback_start(void) {
+
+ pthread_mutex_lock (&g15buf_mutex);
+ playing = 1;
+ paused = 0;
+ pthread_mutex_unlock (&g15buf_mutex);
+ return;
+
+ }
- pthread_mutex_unlock(&g15buf_mutex);
- /* increase lcd drive voltage/contrast for this client */
- g15_send_cmd(g15screen_fd, G15DAEMON_CONTRAST,2);
-
- pthread_attr_t attr;
- memset(&attr,0,sizeof(pthread_attr_t));
- pthread_attr_init(&attr);
- pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED);
- if (enable_keybindings){
- mmedia_timeout_handle = g_timeout_add(100, poll_mmediakeys, NULL);
- g15keys_timeout_handle = g_timeout_add(100, poll_g15keys, NULL);
+ static void g15analyser_playback_stop(void) {
+
+ pthread_mutex_lock (&g15buf_mutex);
+ playing = 0;
+ paused = 0;
+ pthread_mutex_unlock (&g15buf_mutex);
+ return;
+
}
- g15disp_timeout_handle = g_timeout_add(75, g15send_func, NULL);
-}
-
-static void g15analyser_cleanup(void) {
-
- pthread_mutex_lock (&g15buf_mutex);
- /* Write down config */
- g15spectrum_write_config();
- if (canvas != NULL)
- free(canvas);
- if(g15screen_fd)
- close(g15screen_fd);
- pthread_mutex_unlock (&g15buf_mutex);
- if (enable_keybindings){
- XUngrabKey(dpy, XF86XK_AudioPrev, AnyModifier, root_win);
- XUngrabKey(dpy, XF86XK_AudioNext, AnyModifier, root_win);
- XUngrabKey(dpy, XF86XK_AudioPlay, AnyModifier, root_win);
- XUngrabKey(dpy, XF86XK_AudioStop, AnyModifier, root_win);
- XUngrabKey(dpy, XF86XK_AudioLowerVolume, Mod2Mask, root_win);
- XUngrabKey(dpy, XF86XK_AudioRaiseVolume, Mod2Mask, root_win);
- XUngrabKey(dpy, XF86XK_AudioMute, AnyModifier, root_win);
+ static void g15analyser_render_pcm(gint16 data[2][512]) {
+ pthread_mutex_lock (&g15buf_mutex);
- gtk_timeout_remove(mmedia_timeout_handle);
- gtk_timeout_remove(g15keys_timeout_handle);
+ if (playing)
+ {
+ gint i;
+ gint max;
+ gint scale = 128;
+
+ do
+ {
+ max = 0;
+ for (i = 0; i < G15_LCD_WIDTH; i++)
+ {
+ scope_data[i] = data[0][i] / scale; /* FIXME: Use both channels? */
+ if (abs(scope_data[i]) > abs(max))
+ max = scope_data[i];
+ }
+ scale += 128;
+ } while (abs(max) > 10);
+ }
+
+ pthread_mutex_unlock (&g15buf_mutex);
}
- gtk_timeout_remove(g15disp_timeout_handle);
- if (enable_keybindings)
- XCloseDisplay(dpy);
- return;
-}
-
-static void g15analyser_playback_start(void) {
-
- pthread_mutex_lock (&g15buf_mutex);
- playing = 1;
- paused = 0;
- pthread_mutex_unlock (&g15buf_mutex);
- return;
-
-}
-
-static void g15analyser_playback_stop(void) {
-
- pthread_mutex_lock (&g15buf_mutex);
- playing = 0;
- paused = 0;
- pthread_mutex_unlock (&g15buf_mutex);
- return;
-
-}
-
-static void g15analyser_render_pcm(gint16 data[2][512]) {
- pthread_mutex_lock (&g15buf_mutex);
-
- if (playing)
- {
- gint i;
- gint max;
- gint scale = 128;
-
- do
- {
- max = 0;
- for (i = 0; i < G15_LCD_WIDTH; i++)
- {
- scope_data[i] = data[0][i] / scale; /* FIXME: Use both channels? */
- if (abs(scope_data[i]) > abs(max))
- max = scope_data[i];
- }
- scale += 128;
- } while (abs(max) > 10);
- }
-
- pthread_mutex_unlock (&g15buf_mutex);
-}
-
-static void g15analyser_render_freq(gint16 data[2][256]) {
-
-
- pthread_mutex_lock(&g15buf_mutex);
-
- if (playing)
- {
- gint i,drawable_space;
- gdouble y;
- /* code from version 0.1 */
-
- /* dynamically calculate the scale (maybe changed in config) */
- drawable_space = G15_LCD_HEIGHT - INFERIOR_SPACE*show_pbar - SUPERIOR_SPACE*(1-title_overlay)*show_title*rownum + amplification;
- scale = drawable_space / ( log((1 - linearity) / linearity) *2 );
- x00 = linearity*linearity*32768.0/(2 * linearity - 1);
- y00 = -log(-x00) * scale;
-
- for (i = 0; i < WIDTH; i++) {
- y = (gdouble)data[0][i] * (i + 1); /* Compensating the energy */ /* FIXME: Use both channels? */
- y = ( log(y - x00) * scale + y00 ); /* Logarithmic amplitude */
+ static void g15analyser_render_freq(gint16 data[2][256]) {
+
+
+ pthread_mutex_lock(&g15buf_mutex);
+
+ if (playing)
+ {
+ gint i,drawable_space;
+ gdouble y;
+ /* code from version 0.1 */
- y = ( (dif-2)*y + /* FIXME: conditionals should be rolled out of the loop */
- (i==0 ? y : bar_heights[i-1]) +
- (i==WIDTH-1 ? y : bar_heights[i+1])) / dif; /* Add some diffusion */
- y = ((tau-1)*bar_heights[i] + y) / tau; /* Add some dynamics */
- bar_heights[i] = (gint16)y;
+ /* dynamically calculate the scale (maybe changed in config) */
+ drawable_space = G15_LCD_HEIGHT - INFERIOR_SPACE*show_pbar - SUPERIOR_SPACE*(1-title_overlay)*show_title*rownum + amplification;
+ scale = drawable_space / ( log((1 - linearity) / linearity) *2 );
+ x00 = linearity*linearity*32768.0/(2 * linearity - 1);
+ y00 = -log(-x00) * scale;
+
+ for (i = 0; i < WIDTH; i++) {
+ y = (gdouble)data[0][i] * (i + 1); /* Compensating the energy */ /* FIXME: Use both channels? */
+ y = ( log(y - x00) * scale + y00 ); /* Logarithmic amplitude */
+
+ y = ( (dif-2)*y + /* FIXME: conditionals should be rolled out of the loop */
+ (i==0 ? y : bar_heights[i-1]) +
+ (i==WIDTH-1 ? y : bar_heights[i+1])) / dif; /* Add some diffusion */
+ y = ((tau-1)*bar_heights[i] + y) / tau; /* Add some dynamics */
+ bar_heights[i] = (gint16)y;
+ }
+
}
-
- }
+
+ pthread_mutex_unlock(&g15buf_mutex);
+
+ return;
+
+ }
- pthread_mutex_unlock(&g15buf_mutex);
-
- return;
-
-}
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2008-02-09 14:36:25
|
Revision: 459
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=459&view=rev
Author: mlampard
Date: 2008-02-09 06:36:30 -0800 (Sat, 09 Feb 2008)
Log Message:
-----------
Save macro on completion of recording.
Modified Paths:
--------------
trunk/g15daemon-clients/g15macro/ChangeLog
trunk/g15daemon-clients/g15macro/g15macro.c
Modified: trunk/g15daemon-clients/g15macro/ChangeLog
===================================================================
--- trunk/g15daemon-clients/g15macro/ChangeLog 2008-01-31 05:18:40 UTC (rev 458)
+++ trunk/g15daemon-clients/g15macro/ChangeLog 2008-02-09 14:36:30 UTC (rev 459)
@@ -27,3 +27,4 @@
SVN:
- Move g15r_initCanvas() higher in main() to work around a segfault when
libg15render is compiled with FreeType support.
+- Save macro to disk on completion of every recording, not only on exit.
Modified: trunk/g15daemon-clients/g15macro/g15macro.c
===================================================================
--- trunk/g15daemon-clients/g15macro/g15macro.c 2008-01-31 05:18:40 UTC (rev 458)
+++ trunk/g15daemon-clients/g15macro/g15macro.c 2008-02-09 14:36:30 UTC (rev 459)
@@ -72,6 +72,8 @@
int have_xtest = False;
int debug = 0;
+char configpath[1024];
+
unsigned char recstring[1024];
static unsigned int mled_state = G15_LED_M1;
@@ -321,6 +323,7 @@
g15_send(g15screen_fd,(char *)canvas->buffer,G15_BUFFER_LEN);
record_cleanup();
+ save_macros(configpath);
}
int calc_mkey_offset() {
@@ -664,7 +667,7 @@
/* now the default stuff */
pthread_mutex_lock(&x11mutex);
XUngrabKeyboard(dpy,CurrentTime);
- pthread_mutex_unlock(&x11mutex);
+ pthread_mutex_unlock(&x11mutex);
fake_keyevent(keycode,press,event->xkey.state);
@@ -689,6 +692,8 @@
pthread_mutex_unlock(&x11mutex);
recording = 0;
rec_index = 0;
+ printf("saving macro\n");
+ save_macros(configpath);
}
}else
@@ -784,7 +789,6 @@
int dummy=0,i=0;
unsigned char user[256];
struct passwd *username;
- char configpath[1024];
char splashpath[1024];
unsigned int dump = 0;
unsigned int keysonly = 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2008-01-31 05:18:40
|
Revision: 458
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=458&view=rev
Author: mlampard
Date: 2008-01-30 21:18:40 -0800 (Wed, 30 Jan 2008)
Log Message:
-----------
g15daemon 1.9x: Prepare for next release.
Modified Paths:
--------------
trunk/g15daemon-wip/ChangeLog
trunk/g15daemon-wip/configure.in
trunk/g15daemon-wip/debian/changelog
trunk/g15daemon-wip/rpm/g15daemon.spec
Modified: trunk/g15daemon-wip/ChangeLog
===================================================================
--- trunk/g15daemon-wip/ChangeLog 2008-01-31 05:02:46 UTC (rev 457)
+++ trunk/g15daemon-wip/ChangeLog 2008-01-31 05:18:40 UTC (rev 458)
@@ -166,7 +166,7 @@
1.9.5.2:
- BugFix: IS_USER_SELECTED client command was broken. fix it.
- BugFix: restore client ability to change backlight state.
-SVN:
+1.9.5.3:
- BugFix: plugins/g15daemon_net.c: ensure that OOB traffic is not mixed with
normal image buffers.
- Feature: Add --set-backlight to allow clients (and the backlight button)
Modified: trunk/g15daemon-wip/configure.in
===================================================================
--- trunk/g15daemon-wip/configure.in 2008-01-31 05:02:46 UTC (rev 457)
+++ trunk/g15daemon-wip/configure.in 2008-01-31 05:18:40 UTC (rev 458)
@@ -4,7 +4,7 @@
AC_PREREQ(2.59)
-AC_INIT(g15daemon, [1.9.5.2], [mla...@us...])
+AC_INIT(g15daemon, [1.9.5.3], [mla...@us...])
AC_PREFIX_DEFAULT(/usr)
AC_CONFIG_AUX_DIR(config)
AC_CANONICAL_HOST()
Modified: trunk/g15daemon-wip/debian/changelog
===================================================================
--- trunk/g15daemon-wip/debian/changelog 2008-01-31 05:02:46 UTC (rev 457)
+++ trunk/g15daemon-wip/debian/changelog 2008-01-31 05:18:40 UTC (rev 458)
@@ -1,3 +1,13 @@
+g15daemon 1.9.5.3 edgy; urgency=low
+ * BugFix: plugins/g15daemon_net.c: ensure that OOB traffic is not mixed with
+ normal image buffers.
+ * Feature: Add --set-backlight to allow clients (and the backlight button)
+ to set the backlight level for the currently shown screen only.
+ Default is now to disallow clients changing backlight, and to set
+ backlight globally via the button.
+
+ -- Mike Lampard <mla...@us...> Thu, 31 Jan 2008 15:47:06 +1030
+
g15daemon 1.9.5.2 edgy; urgency=high
* BugFix: IS_USER_SELECTED client command was broken. fix it.
* BugFix: restore client ability to change backlight state.
Modified: trunk/g15daemon-wip/rpm/g15daemon.spec
===================================================================
--- trunk/g15daemon-wip/rpm/g15daemon.spec 2008-01-31 05:02:46 UTC (rev 457)
+++ trunk/g15daemon-wip/rpm/g15daemon.spec 2008-01-31 05:18:40 UTC (rev 458)
@@ -3,11 +3,11 @@
%define prefix /usr
Summary: Daemon to control logitech G15 keyboards
Name: g15daemon
-Version: 1.9.5.2
+Version: 1.9.5.3
Release: 1
Copyright: GPL
Group: Applications/System
-Source: ftp://prdownloads.sf.net/g15daemon-1.9.5.2.tar.bz2
+Source: ftp://prdownloads.sf.net/g15daemon-1.9.5.3.tar.bz2
URL: http://g15daemon.sf.net
Distribution: Linux
Vendor: NONE
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2008-01-31 05:02:53
|
Revision: 457
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=457&view=rev
Author: mlampard
Date: 2008-01-30 21:02:46 -0800 (Wed, 30 Jan 2008)
Log Message:
-----------
g15daemon 1.9x: Add --set-backlight cmdline option to allow for individual per-screen backlight settings
Modified Paths:
--------------
trunk/g15daemon-wip/ChangeLog
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/ChangeLog
===================================================================
--- trunk/g15daemon-wip/ChangeLog 2008-01-28 06:05:31 UTC (rev 456)
+++ trunk/g15daemon-wip/ChangeLog 2008-01-31 05:02:46 UTC (rev 457)
@@ -169,3 +169,7 @@
SVN:
- BugFix: plugins/g15daemon_net.c: ensure that OOB traffic is not mixed with
normal image buffers.
+- Feature: Add --set-backlight to allow clients (and the backlight button)
+ to set the backlight level for the currently shown screen only. Default is
+ now to disallow clients changing backlight, and to set backlight globally
+ via the button.
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2008-01-28 06:05:31 UTC (rev 456)
+++ trunk/g15daemon-wip/g15daemon/main.c 2008-01-31 05:02:46 UTC (rev 457)
@@ -54,6 +54,7 @@
unsigned int g15daemon_debug = 0;
unsigned int cycle_key;
unsigned int client_handles_keys = 0;
+static unsigned int set_backlight = 0;
struct lcd_t *keyhandler = NULL;
static int loaded_plugins = 0;
@@ -246,7 +247,7 @@
uf_write_buf_to_g15(displaying);
g15daemon_log(LOG_DEBUG,"LCD Update Complete");
- if(prev_state!=displaying->backlight_state) {
+ if(prev_state!=displaying->backlight_state && set_backlight!=0) {
prev_state=displaying->backlight_state;
pthread_mutex_lock(&g15lib_mutex);
setLCDBrightness(displaying->backlight_state);
@@ -362,13 +363,14 @@
if (!strncmp(daemonargs, "-h",2) || !strncmp(daemonargs, "--help",6)) {
printf("G15Daemon version %s - %s\n",VERSION,uf_return_running() >= 0 ?"Loaded & Running":"Not Running");
- printf("%s -h (--help) or -k (--kill) or -s (--switch) or -d (--debug) [level] or -v (--version) or -l (--lcdlevel) [0-2] \n\n -k will kill a previous incarnation",argv[0]);
+ printf("%s -h (--help) or -k (--kill) or -s (--switch) or -d (--debug) [level] or -v (--version) or -l (--lcdlevel) [0-2] \n\n -k\twill kill a previous incarnation",argv[0]);
#ifdef LIBG15_VERSION
#if LIBG15_VERSION >= 1200
- printf(", if uppercase -K or -KILL turn off the keyboard backlight on the way out.");
+ printf("\n -K\tturn off the keyboard backlight on the way out.");
#endif
#endif
- printf("\n -h shows this help\n -s changes the screen-switch key from L1 to MR (beware)\n -d debug mode - stay in foreground and output all debug messages to STDERR\n -v show version\n -l set default LCD backlight level\n");
+ printf("\n -h\tshows this help\n -s\tchanges the screen-switch key from L1 to MR (beware)\n -d\tdebug mode - stay in foreground and output all debug messages to STDERR\n -v\tshow version\n -l\tset default LCD backlight level\n");
+ printf(" --set-backlight sets backlight individually for currently shown screen.\n\t\tDefault is to set backlight globally (keyboard default).\n");
exit(0);
}
@@ -377,6 +379,10 @@
cycle_cmdline_override=1;
}
+ if (!strncmp(daemonargs, "--set-backlight",15)) {
+ set_backlight = 1;
+ }
+
if (!strncmp(daemonargs, "-d",2) || !strncmp(daemonargs, "--debug",7)) {
g15daemon_debug = 1;
if((argv[i+1])!=NULL)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2008-01-28 06:07:47
|
Revision: 456
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=456&view=rev
Author: mlampard
Date: 2008-01-27 22:05:31 -0800 (Sun, 27 Jan 2008)
Log Message:
-----------
g15daemon 1.9x: ensure that OOB traffic is kept separate from image buffers in g15_recv().
Modified Paths:
--------------
trunk/g15daemon-wip/ChangeLog
trunk/g15daemon-wip/plugins/g15_plugin_net.c
Modified: trunk/g15daemon-wip/ChangeLog
===================================================================
--- trunk/g15daemon-wip/ChangeLog 2008-01-27 06:58:43 UTC (rev 455)
+++ trunk/g15daemon-wip/ChangeLog 2008-01-28 06:05:31 UTC (rev 456)
@@ -166,3 +166,6 @@
1.9.5.2:
- BugFix: IS_USER_SELECTED client command was broken. fix it.
- BugFix: restore client ability to change backlight state.
+SVN:
+- BugFix: plugins/g15daemon_net.c: ensure that OOB traffic is not mixed with
+ normal image buffers.
Modified: trunk/g15daemon-wip/plugins/g15_plugin_net.c
===================================================================
--- trunk/g15daemon-wip/plugins/g15_plugin_net.c 2008-01-27 06:58:43 UTC (rev 455)
+++ trunk/g15daemon-wip/plugins/g15_plugin_net.c 2008-01-28 06:05:31 UTC (rev 456)
@@ -219,7 +219,7 @@
}
process_client_cmds(lcdnode, sock, msgbuf,len);
}
- else if(pfd[0].revents & POLLIN && !(pfd[0].revents & POLLERR || pfd[0].revents & POLLHUP || pfd[0].revents & POLLNVAL)) {
+ else if(pfd[0].revents & POLLIN && !(pfd[0].revents & POLLERR || pfd[0].revents & POLLHUP || pfd[0].revents & POLLNVAL || pfd[0].revents & POLLPRI)) {
retval = recv(sock, buf+total, bytesleft, 0);
if (retval < 1) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2008-01-27 06:58:41
|
Revision: 455
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=455&view=rev
Author: mlampard
Date: 2008-01-26 22:58:43 -0800 (Sat, 26 Jan 2008)
Log Message:
-----------
g15macro: fix a segfault in g15r_initCanvas() when Freetype support is compiled in. For some reason FT_Init_Freetype() doesn't like being called after XOpenDisplay() on my system.
Modified Paths:
--------------
trunk/g15daemon-clients/g15macro/ChangeLog
trunk/g15daemon-clients/g15macro/g15macro.c
Modified: trunk/g15daemon-clients/g15macro/ChangeLog
===================================================================
--- trunk/g15daemon-clients/g15macro/ChangeLog 2008-01-26 05:30:51 UTC (rev 454)
+++ trunk/g15daemon-clients/g15macro/ChangeLog 2008-01-27 06:58:43 UTC (rev 455)
@@ -24,3 +24,6 @@
any of the M keys, and moves repeated code into their own functions.
- Add --help, --keysonly cmdline options. --keysonly configures keymaps
(including multimedia keys) then exits.
+SVN:
+- Move g15r_initCanvas() higher in main() to work around a segfault when
+ libg15render is compiled with FreeType support.
Modified: trunk/g15daemon-clients/g15macro/g15macro.c
===================================================================
--- trunk/g15daemon-clients/g15macro/g15macro.c 2008-01-26 05:30:51 UTC (rev 454)
+++ trunk/g15daemon-clients/g15macro/g15macro.c 2008-01-27 06:58:43 UTC (rev 455)
@@ -843,6 +843,15 @@
}
}
+ canvas = (g15canvas *) malloc (sizeof (g15canvas));
+
+ if (canvas != NULL) {
+ g15r_initCanvas(canvas);
+ } else {
+ printf("Unable to initialise the libg15render canvas\nExiting\n");
+ return 1;
+ }
+
do {
dpy = XOpenDisplay(getenv("DISPLAY"));
if (!dpy) {
@@ -916,21 +925,14 @@
usleep(1000);
g15_send_cmd (g15screen_fd,G15DAEMON_MKEYLEDS,mled_state);
usleep(1000);
- canvas = (g15canvas *) malloc (sizeof (g15canvas));
- if (canvas != NULL) {
- g15r_initCanvas(canvas);
- } else {
- printf("Unable to initialise the libg15render canvas\nExiting\n");
- return 1;
- }
-
root_win = DefaultRootWindow(dpy);
if (!root_win) {
printf("Cant find root window\n");
return 1;
}
+
have_xtest = False;
#ifdef HAVE_XTEST
#ifdef USE_XTEST
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2008-01-26 05:30:45
|
Revision: 454
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=454&view=rev
Author: mlampard
Date: 2008-01-25 21:30:51 -0800 (Fri, 25 Jan 2008)
Log Message:
-----------
g15daemon 1.9x: one last pass at per-lcd backlight state before I simply disable it.
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2008-01-26 01:15:36 UTC (rev 453)
+++ trunk/g15daemon-wip/g15daemon/main.c 2008-01-26 05:30:51 UTC (rev 454)
@@ -88,7 +88,7 @@
g15daemon_log(LOG_WARNING,"Error in send: %s\n",strerror(errno));
}
if(value & G15_KEY_LIGHT){ // the backlight key was pressed - maintain user-selected state
- lcd_t *displaying = lcd->masterlist->tail->lcd;
+ lcd_t *displaying = lcd->masterlist->current->lcd;
lcd->masterlist->kb_backlight_state++;
lcd->masterlist->kb_backlight_state %= 3;
displaying->backlight_state++;
@@ -250,6 +250,9 @@
prev_state=displaying->backlight_state;
pthread_mutex_lock(&g15lib_mutex);
setLCDBrightness(displaying->backlight_state);
+ usleep(5);
+ setLCDBrightness(displaying->backlight_state);
+ setKBBrightness(displaying->backlight_state);
pthread_mutex_unlock(&g15lib_mutex);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2008-01-26 01:15:34
|
Revision: 453
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=453&view=rev
Author: mlampard
Date: 2008-01-25 17:15:36 -0800 (Fri, 25 Jan 2008)
Log Message:
-----------
g15daemon 1.9x: prepare for new release.
Modified Paths:
--------------
trunk/g15daemon-wip/ChangeLog
trunk/g15daemon-wip/configure.in
trunk/g15daemon-wip/debian/changelog
trunk/g15daemon-wip/rpm/g15daemon.spec
Modified: trunk/g15daemon-wip/ChangeLog
===================================================================
--- trunk/g15daemon-wip/ChangeLog 2008-01-25 05:34:31 UTC (rev 452)
+++ trunk/g15daemon-wip/ChangeLog 2008-01-26 01:15:36 UTC (rev 453)
@@ -163,6 +163,6 @@
1.9.5.1:
- BugFix: If lcd refresh is requested whilst processing, refreshes were missed.
- Optimisation: The delay between screen updates is no longer required. remove.
-SVN:
+1.9.5.2:
- BugFix: IS_USER_SELECTED client command was broken. fix it.
- BugFix: restore client ability to change backlight state.
Modified: trunk/g15daemon-wip/configure.in
===================================================================
--- trunk/g15daemon-wip/configure.in 2008-01-25 05:34:31 UTC (rev 452)
+++ trunk/g15daemon-wip/configure.in 2008-01-26 01:15:36 UTC (rev 453)
@@ -4,7 +4,7 @@
AC_PREREQ(2.59)
-AC_INIT(g15daemon, [1.9.5.1], [mla...@us...])
+AC_INIT(g15daemon, [1.9.5.2], [mla...@us...])
AC_PREFIX_DEFAULT(/usr)
AC_CONFIG_AUX_DIR(config)
AC_CANONICAL_HOST()
Modified: trunk/g15daemon-wip/debian/changelog
===================================================================
--- trunk/g15daemon-wip/debian/changelog 2008-01-25 05:34:31 UTC (rev 452)
+++ trunk/g15daemon-wip/debian/changelog 2008-01-26 01:15:36 UTC (rev 453)
@@ -1,8 +1,14 @@
-1.9.5.1 edgy; urgency=high
+g15daemon 1.9.5.2 edgy; urgency=high
+ * BugFix: IS_USER_SELECTED client command was broken. fix it.
+ * BugFix: restore client ability to change backlight state.
+
+ -- Mike Lampard <mla...@us...> Sat, 26 Jan 2008 11:36:04 +1030
+
+g15daemon 1.9.5.1 edgy; urgency=high
* BugFix: If lcd refresh is requested whilst processing, refreshes were missed.
* Optimisation: The delay between screen updates is no longer required. remove.
-1.9.5 edgy; urgency=low
+g15daemon 1.9.5 edgy; urgency=low
* Add example udev helper scripts to contrib directory.
* API: Add NEVER_SELECT cmd to client API to enforce non-display on
client-switch. Used by G15Macro if available.
Modified: trunk/g15daemon-wip/rpm/g15daemon.spec
===================================================================
--- trunk/g15daemon-wip/rpm/g15daemon.spec 2008-01-25 05:34:31 UTC (rev 452)
+++ trunk/g15daemon-wip/rpm/g15daemon.spec 2008-01-26 01:15:36 UTC (rev 453)
@@ -3,11 +3,11 @@
%define prefix /usr
Summary: Daemon to control logitech G15 keyboards
Name: g15daemon
-Version: 1.9.5.1
+Version: 1.9.5.2
Release: 1
Copyright: GPL
Group: Applications/System
-Source: ftp://prdownloads.sf.net/g15daemon-1.9.5.1.tar.bz2
+Source: ftp://prdownloads.sf.net/g15daemon-1.9.5.2.tar.bz2
URL: http://g15daemon.sf.net
Distribution: Linux
Vendor: NONE
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2008-01-25 05:34:25
|
Revision: 452
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=452&view=rev
Author: mlampard
Date: 2008-01-24 21:34:31 -0800 (Thu, 24 Jan 2008)
Log Message:
-----------
g15daemon 1.9x: restore client ability to change backlight state for individual screens.
Modified Paths:
--------------
trunk/g15daemon-wip/ChangeLog
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/ChangeLog
===================================================================
--- trunk/g15daemon-wip/ChangeLog 2008-01-25 04:45:04 UTC (rev 451)
+++ trunk/g15daemon-wip/ChangeLog 2008-01-25 05:34:31 UTC (rev 452)
@@ -165,3 +165,4 @@
- Optimisation: The delay between screen updates is no longer required. remove.
SVN:
- BugFix: IS_USER_SELECTED client command was broken. fix it.
+- BugFix: restore client ability to change backlight state.
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2008-01-25 04:45:04 UTC (rev 451)
+++ trunk/g15daemon-wip/g15daemon/main.c 2008-01-25 05:34:31 UTC (rev 452)
@@ -226,7 +226,7 @@
/* unsigned int fps = 0; */
lcd_t *displaying = masterlist->tail->lcd;
memset(displaying->buf,0,1024);
-
+ static int prev_state=0;
g15daemon_sleep(2);
while (!leaving) {
@@ -246,15 +246,18 @@
uf_write_buf_to_g15(displaying);
g15daemon_log(LOG_DEBUG,"LCD Update Complete");
+ if(prev_state!=displaying->backlight_state) {
+ prev_state=displaying->backlight_state;
+ pthread_mutex_lock(&g15lib_mutex);
+ setLCDBrightness(displaying->backlight_state);
+ pthread_mutex_unlock(&g15lib_mutex);
+ }
+
if(displaying->state_changed){
pthread_mutex_lock(&g15lib_mutex);
setLCDContrast(displaying->contrast_state);
if(displaying->masterlist->remote_keyhandler_sock==0) // only allow mled control if the macro recorder isnt running
setLEDs(displaying->mkey_state);
- if(masterlist->kb_backlight_state)
- setLCDBrightness(displaying->backlight_state);
- else
- setLCDBrightness(masterlist->kb_backlight_state);
pthread_mutex_unlock(&g15lib_mutex);
displaying->state_changed = 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2008-01-25 04:44:59
|
Revision: 451
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=451&view=rev
Author: mlampard
Date: 2008-01-24 20:45:04 -0800 (Thu, 24 Jan 2008)
Log Message:
-----------
g15daemon 1.9x: IS_USER_SELECTED client cmd was broken some time in the distant past. Fix it.
Modified Paths:
--------------
trunk/g15daemon-wip/ChangeLog
trunk/g15daemon-wip/g15daemon/linked_lists.c
trunk/g15daemon-wip/libg15daemon_client/g15daemon_net.c
trunk/g15daemon-wip/plugins/g15_plugin_net.c
Modified: trunk/g15daemon-wip/ChangeLog
===================================================================
--- trunk/g15daemon-wip/ChangeLog 2008-01-24 09:29:54 UTC (rev 450)
+++ trunk/g15daemon-wip/ChangeLog 2008-01-25 04:45:04 UTC (rev 451)
@@ -160,6 +160,8 @@
/tmp/g15daemon-sc-?.pbm, where ? is an incremental number.
- BugFix: Only wakeup display thread if LCD buffer is visible.
- Packaging: Fix debian packaging to include plugins.
-SVN: (1.9.6)
+1.9.5.1:
- BugFix: If lcd refresh is requested whilst processing, refreshes were missed.
- Optimisation: The delay between screen updates is no longer required. remove.
+SVN:
+- BugFix: IS_USER_SELECTED client command was broken. fix it.
Modified: trunk/g15daemon-wip/g15daemon/linked_lists.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/linked_lists.c 2008-01-24 09:29:54 UTC (rev 450)
+++ trunk/g15daemon-wip/g15daemon/linked_lists.c 2008-01-25 04:45:04 UTC (rev 451)
@@ -124,8 +124,8 @@
g15daemon_send_event(current_screen->lcd, G15_EVENT_VISIBILITY_CHANGED, SCR_HIDDEN);
do
{
- g15daemon_send_event(current_screen->lcd, G15_EVENT_USER_FOREGROUND, 0);
-
+ masterlist->current->lcd->usr_foreground=0;
+
if(masterlist->tail == masterlist->current){
masterlist->current = masterlist->head;
}else{
@@ -147,7 +147,7 @@
masterlist->current->last_priority = masterlist->current;
pthread_mutex_unlock(&lcdlist_mutex);
- g15daemon_send_event(current_screen->lcd, G15_EVENT_USER_FOREGROUND, 1);
+ masterlist->current->lcd->usr_foreground=1;
g15daemon_send_event(masterlist->current->lcd, G15_EVENT_VISIBILITY_CHANGED, SCR_VISIBLE);
}
Modified: trunk/g15daemon-wip/libg15daemon_client/g15daemon_net.c
===================================================================
--- trunk/g15daemon-wip/libg15daemon_client/g15daemon_net.c 2008-01-24 09:29:54 UTC (rev 450)
+++ trunk/g15daemon-wip/libg15daemon_client/g15daemon_net.c 2008-01-25 04:45:04 UTC (rev 451)
@@ -286,12 +286,12 @@
case G15DAEMON_IS_USER_SELECTED:{
packet[0] = (unsigned char)command;
send( sock, packet, 1, MSG_OOB );
- retval = g15_recv_oob_answer(sock) - 48;
+ retval = g15_recv_oob_answer(sock);
break;
}
default:
return -1;
}
-
+ usleep(1000);
return retval;
}
Modified: trunk/g15daemon-wip/plugins/g15_plugin_net.c
===================================================================
--- trunk/g15daemon-wip/plugins/g15_plugin_net.c 2008-01-24 09:29:54 UTC (rev 450)
+++ trunk/g15daemon-wip/plugins/g15_plugin_net.c 2008-01-25 04:45:04 UTC (rev 451)
@@ -89,12 +89,12 @@
}
case CLIENT_CMD_IS_USER_SELECTED: { /* client wants to know if it was set to foreground by the user */
pthread_mutex_lock(&lcdlist_mutex);
- if(lcdnode->lcd->usr_foreground) /* user manually selected this lcd */
- msgbuf[0] = '1';
+ if(lcdnode->lcd->usr_foreground==1) /* user manually selected this lcd */
+ msgbuf[0] = 1;
else
- msgbuf[0] = '0';
+ msgbuf[0] = 0;
pthread_mutex_unlock(&lcdlist_mutex);
- send(sock,msgbuf,1,0);
+ send(sock,msgbuf,1,MSG_OOB);
break;
}
default:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2008-01-24 09:29:50
|
Revision: 450
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=450&view=rev
Author: mlampard
Date: 2008-01-24 01:29:54 -0800 (Thu, 24 Jan 2008)
Log Message:
-----------
g15daemon 1.9x: Release 1.9.5.1
Modified Paths:
--------------
trunk/g15daemon-wip/configure.in
trunk/g15daemon-wip/debian/changelog
trunk/g15daemon-wip/rpm/g15daemon.spec
Modified: trunk/g15daemon-wip/configure.in
===================================================================
--- trunk/g15daemon-wip/configure.in 2008-01-24 07:12:07 UTC (rev 449)
+++ trunk/g15daemon-wip/configure.in 2008-01-24 09:29:54 UTC (rev 450)
@@ -4,7 +4,7 @@
AC_PREREQ(2.59)
-AC_INIT(g15daemon, [1.9.5], [mla...@us...])
+AC_INIT(g15daemon, [1.9.5.1], [mla...@us...])
AC_PREFIX_DEFAULT(/usr)
AC_CONFIG_AUX_DIR(config)
AC_CANONICAL_HOST()
Modified: trunk/g15daemon-wip/debian/changelog
===================================================================
--- trunk/g15daemon-wip/debian/changelog 2008-01-24 07:12:07 UTC (rev 449)
+++ trunk/g15daemon-wip/debian/changelog 2008-01-24 09:29:54 UTC (rev 450)
@@ -1,3 +1,7 @@
+1.9.5.1 edgy; urgency=high
+ * BugFix: If lcd refresh is requested whilst processing, refreshes were missed.
+ * Optimisation: The delay between screen updates is no longer required. remove.
+
1.9.5 edgy; urgency=low
* Add example udev helper scripts to contrib directory.
* API: Add NEVER_SELECT cmd to client API to enforce non-display on
Modified: trunk/g15daemon-wip/rpm/g15daemon.spec
===================================================================
--- trunk/g15daemon-wip/rpm/g15daemon.spec 2008-01-24 07:12:07 UTC (rev 449)
+++ trunk/g15daemon-wip/rpm/g15daemon.spec 2008-01-24 09:29:54 UTC (rev 450)
@@ -3,11 +3,11 @@
%define prefix /usr
Summary: Daemon to control logitech G15 keyboards
Name: g15daemon
-Version: 1.9.5
+Version: 1.9.5.1
Release: 1
Copyright: GPL
Group: Applications/System
-Source: ftp://prdownloads.sf.net/g15daemon-1.9.5.tar.bz2
+Source: ftp://prdownloads.sf.net/g15daemon-1.9.5.1.tar.bz2
URL: http://g15daemon.sf.net
Distribution: Linux
Vendor: NONE
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2008-01-24 07:12:27
|
Revision: 449
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=449&view=rev
Author: mlampard
Date: 2008-01-23 23:12:07 -0800 (Wed, 23 Jan 2008)
Log Message:
-----------
g15daemon 1.9x: work around bug exposed by g15composer - occasionally screens were not being updated.
Modified Paths:
--------------
trunk/g15daemon-wip/ChangeLog
trunk/g15daemon-wip/g15daemon/main.c
trunk/g15daemon-wip/g15daemon/utility_funcs.c
Modified: trunk/g15daemon-wip/ChangeLog
===================================================================
--- trunk/g15daemon-wip/ChangeLog 2008-01-24 04:01:44 UTC (rev 448)
+++ trunk/g15daemon-wip/ChangeLog 2008-01-24 07:12:07 UTC (rev 449)
@@ -160,3 +160,6 @@
/tmp/g15daemon-sc-?.pbm, where ? is an incremental number.
- BugFix: Only wakeup display thread if LCD buffer is visible.
- Packaging: Fix debian packaging to include plugins.
+SVN: (1.9.6)
+- BugFix: If lcd refresh is requested whilst processing, refreshes were missed.
+- Optimisation: The delay between screen updates is no longer required. remove.
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2008-01-24 04:01:44 UTC (rev 448)
+++ trunk/g15daemon-wip/g15daemon/main.c 2008-01-24 07:12:07 UTC (rev 449)
@@ -223,10 +223,8 @@
static void *lcd_draw_thread(void *lcdlist){
g15daemon_t *masterlist = (g15daemon_t*)(lcdlist);
- static unsigned int lastscreentime;
/* unsigned int fps = 0; */
lcd_t *displaying = masterlist->tail->lcd;
- char *lastdisplayed=NULL;
memset(displaying->buf,0,1024);
g15daemon_sleep(2);
@@ -244,13 +242,9 @@
/* if the current screen is less than 20ms from the previous (equivelant to 50fps) delay it */
/* this allows a real-world fps of 40fps with no almost frame loss and reduces peak usb bus-load */
- if((g15daemon_gettime_ms() - lastscreentime)>=20||(char*)displaying!=lastdisplayed){
- g15daemon_log(LOG_DEBUG,"Updating LCD");
- uf_write_buf_to_g15(displaying);
- lastscreentime = g15daemon_gettime_ms();
- lastdisplayed = (char*)displaying;
- g15daemon_log(LOG_DEBUG,"LCD Update Complete");
- }
+ g15daemon_log(LOG_DEBUG,"Updating LCD");
+ uf_write_buf_to_g15(displaying);
+ g15daemon_log(LOG_DEBUG,"LCD Update Complete");
if(displaying->state_changed){
pthread_mutex_lock(&g15lib_mutex);
Modified: trunk/g15daemon-wip/g15daemon/utility_funcs.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/utility_funcs.c 2008-01-24 04:01:44 UTC (rev 448)
+++ trunk/g15daemon-wip/g15daemon/utility_funcs.c 2008-01-24 07:12:07 UTC (rev 449)
@@ -75,34 +75,39 @@
return ptr;
}
-
+static int refresh_pending=0;
void g15daemon_init_refresh() {
pthread_condattr_t attr;
pthread_cond_init(&lcd_refresh, &attr);
}
void g15daemon_send_refresh(lcd_t *lcd) {
- if(lcd==lcd->masterlist->current->lcd||lcd->state_changed)
+ if(lcd==lcd->masterlist->current->lcd||lcd->state_changed) {
pthread_cond_broadcast(&lcd_refresh);
+ refresh_pending++;
+ }
}
void g15daemon_wait_refresh() {
pthread_mutex_t dummy_mutex;
struct timespec timeout;
int retval;
- /* Create a dummy mutex which doesn't unlock for sure while waiting. */
- pthread_mutex_init(&dummy_mutex, NULL);
- pthread_mutex_lock(&dummy_mutex);
+ if(refresh_pending<1) {
+ /* Create a dummy mutex which doesn't unlock for sure while waiting. */
+ pthread_mutex_init(&dummy_mutex, NULL);
+ pthread_mutex_lock(&dummy_mutex);
start:
- time(&timeout.tv_sec);
- timeout.tv_sec += 1;
- timeout.tv_nsec = 0L;
+ time(&timeout.tv_sec);
+ timeout.tv_sec += 1;
+ timeout.tv_nsec = 0L;
- retval=pthread_cond_timedwait(&lcd_refresh, &dummy_mutex, &timeout);
- if(!leaving && retval == ETIMEDOUT)
- goto start;
- pthread_mutex_unlock(&dummy_mutex);
- pthread_mutex_destroy(&dummy_mutex);
+ retval=pthread_cond_timedwait(&lcd_refresh, &dummy_mutex, &timeout);
+ if(!leaving && retval == ETIMEDOUT)
+ goto start;
+ pthread_mutex_unlock(&dummy_mutex);
+ pthread_mutex_destroy(&dummy_mutex);
+ }
+ refresh_pending--;
}
void g15daemon_quit_refresh() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2008-01-24 04:01:42
|
Revision: 448
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=448&view=rev
Author: mlampard
Date: 2008-01-23 20:01:44 -0800 (Wed, 23 Jan 2008)
Log Message:
-----------
g15mpd: fix segfault when exiting due to unavailability of MPD server.
Modified Paths:
--------------
trunk/g15daemon-audio-plugins/g15mpd/ChangeLog
trunk/g15daemon-audio-plugins/g15mpd/g15mpd.c
Modified: trunk/g15daemon-audio-plugins/g15mpd/ChangeLog
===================================================================
--- trunk/g15daemon-audio-plugins/g15mpd/ChangeLog 2008-01-23 11:05:31 UTC (rev 447)
+++ trunk/g15daemon-audio-plugins/g15mpd/ChangeLog 2008-01-24 04:01:44 UTC (rev 448)
@@ -15,3 +15,4 @@
through playlist if --quickscroll option is used, otherwise uses prev/next
keys.
- Only respond to mmedia keys if the display is in the foreground.
+- Fix segfault when exiting due to unavailability of MPD server.
Modified: trunk/g15daemon-audio-plugins/g15mpd/g15mpd.c
===================================================================
--- trunk/g15daemon-audio-plugins/g15mpd/g15mpd.c 2008-01-23 11:05:31 UTC (rev 447)
+++ trunk/g15daemon-audio-plugins/g15mpd/g15mpd.c 2008-01-24 04:01:44 UTC (rev 448)
@@ -653,7 +653,7 @@
/* Set timeout */
mpd_set_connection_timeout(obj, 10);
- if(!mpd_connect(obj))
+ if(0==mpd_connect(obj))
{
char buffer[20];
pthread_attr_t attr;
@@ -707,8 +707,14 @@
pthread_mutex_unlock(&daemon_mutex);
}while(!usleep(5000) && !leaving);
- }
- mpd_free(obj);
+ leaving = 1;
+ pthread_join(Lkeys,NULL);
+ pthread_join(g15display,NULL);
+ }else
+ printf("Unable to connect to MPD server. Exiting\n");
+
+ if(obj)
+ mpd_free(obj);
close(fdstdin);
if(canvas!=NULL)
@@ -716,9 +722,6 @@
close(g15screen_fd);
close(mmedia_fd);
- leaving = 1;
- pthread_join(Lkeys,NULL);
- pthread_join(g15display,NULL);
pthread_mutex_destroy(&lockit);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2008-01-23 11:05:26
|
Revision: 447
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=447&view=rev
Author: mlampard
Date: 2008-01-23 03:05:31 -0800 (Wed, 23 Jan 2008)
Log Message:
-----------
g15daemon 1.9x: prepare for release 1.9.5
Modified Paths:
--------------
trunk/g15daemon-wip/ChangeLog
trunk/g15daemon-wip/configure.in
trunk/g15daemon-wip/debian/changelog
trunk/g15daemon-wip/rpm/g15daemon.spec
Modified: trunk/g15daemon-wip/ChangeLog
===================================================================
--- trunk/g15daemon-wip/ChangeLog 2008-01-23 11:00:13 UTC (rev 446)
+++ trunk/g15daemon-wip/ChangeLog 2008-01-23 11:05:31 UTC (rev 447)
@@ -149,7 +149,7 @@
blocks on read.
- Optimisation: Use pthread conditional variable to signal LCD state change.
Further reduces unnecessary wakeups.
-1.9.4->SVN
+1.9.5
- Add example udev helper scripts to contrib directory.
- API: Add NEVER_SELECT cmd to client API to enforce non-display on
client-switch. Used by G15Macro if available.
@@ -159,3 +159,4 @@
a pbm format image of the currently displayed screen to
/tmp/g15daemon-sc-?.pbm, where ? is an incremental number.
- BugFix: Only wakeup display thread if LCD buffer is visible.
+- Packaging: Fix debian packaging to include plugins.
Modified: trunk/g15daemon-wip/configure.in
===================================================================
--- trunk/g15daemon-wip/configure.in 2008-01-23 11:00:13 UTC (rev 446)
+++ trunk/g15daemon-wip/configure.in 2008-01-23 11:05:31 UTC (rev 447)
@@ -4,7 +4,7 @@
AC_PREREQ(2.59)
-AC_INIT(g15daemon, [1.9.4], [mla...@us...])
+AC_INIT(g15daemon, [1.9.5], [mla...@us...])
AC_PREFIX_DEFAULT(/usr)
AC_CONFIG_AUX_DIR(config)
AC_CANONICAL_HOST()
Modified: trunk/g15daemon-wip/debian/changelog
===================================================================
--- trunk/g15daemon-wip/debian/changelog 2008-01-23 11:00:13 UTC (rev 446)
+++ trunk/g15daemon-wip/debian/changelog 2008-01-23 11:05:31 UTC (rev 447)
@@ -1,3 +1,15 @@
+1.9.5 edgy; urgency=low
+ * Add example udev helper scripts to contrib directory.
+ * API: Add NEVER_SELECT cmd to client API to enforce non-display on
+ client-switch. Used by G15Macro if available.
+ * Debug: Add segfault handler to libg15daemon_client to aid debugging
+ clients.
+ * Feature: Add screendump ability. Pressing M1+M3 simultaneously will write
+ a pbm format image of the currently displayed screen to
+ /tmp/g15daemon-sc-?.pbm, where ? is an incremental number.
+ * BugFix: Only wakeup display thread if LCD buffer is visible.
+ * Packaging: Fix debian packaging to include plugins.
+
g15daemon 1.9.4 edgy; urgency=low
* Debug: Log warning if keyboard disappears.
* Bugfix: Fix autoconf autodetect bugs re uinput plugin.
Modified: trunk/g15daemon-wip/rpm/g15daemon.spec
===================================================================
--- trunk/g15daemon-wip/rpm/g15daemon.spec 2008-01-23 11:00:13 UTC (rev 446)
+++ trunk/g15daemon-wip/rpm/g15daemon.spec 2008-01-23 11:05:31 UTC (rev 447)
@@ -3,11 +3,11 @@
%define prefix /usr
Summary: Daemon to control logitech G15 keyboards
Name: g15daemon
-Version: 1.9.4
+Version: 1.9.5
Release: 1
Copyright: GPL
Group: Applications/System
-Source: ftp://prdownloads.sf.net/g15daemon-1.9.4.tar.bz2
+Source: ftp://prdownloads.sf.net/g15daemon-1.9.5.tar.bz2
URL: http://g15daemon.sf.net
Distribution: Linux
Vendor: NONE
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2008-01-23 11:00:08
|
Revision: 446
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=446&view=rev
Author: mlampard
Date: 2008-01-23 03:00:13 -0800 (Wed, 23 Jan 2008)
Log Message:
-----------
g15macro: prepare for 1.0.3 release
Modified Paths:
--------------
trunk/g15daemon-clients/g15macro/ChangeLog
trunk/g15daemon-clients/g15macro/configure.in
Modified: trunk/g15daemon-clients/g15macro/ChangeLog
===================================================================
--- trunk/g15daemon-clients/g15macro/ChangeLog 2008-01-23 08:26:23 UTC (rev 445)
+++ trunk/g15daemon-clients/g15macro/ChangeLog 2008-01-23 11:00:13 UTC (rev 446)
@@ -15,7 +15,7 @@
- Add --dump (-d) option to dump recorded macros in human-readable format
- Add --version (-v)
- Add --debug (-g) to add some debugging
-SVN (1.0.3):
+1.0.3:
- Switch to a textual configuration file. Auto-converts to new format from binary
config if it exists. Only Semi-readable, but better than a binary dump.
- Ensure each keypress is received by X11 in sequence.
Modified: trunk/g15daemon-clients/g15macro/configure.in
===================================================================
--- trunk/g15daemon-clients/g15macro/configure.in 2008-01-23 08:26:23 UTC (rev 445)
+++ trunk/g15daemon-clients/g15macro/configure.in 2008-01-23 11:00:13 UTC (rev 446)
@@ -1,4 +1,4 @@
-AC_INIT(g15macro,[1.0.3svn], [mla...@us...])
+AC_INIT(g15macro,[1.0.3], [mla...@us...])
PACKAGE=g15macro
VERSION=1.0.3
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2008-01-23 08:26:17
|
Revision: 445
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=445&view=rev
Author: mlampard
Date: 2008-01-23 00:26:23 -0800 (Wed, 23 Jan 2008)
Log Message:
-----------
g15macro: small cleanup.
Modified Paths:
--------------
trunk/g15daemon-clients/g15macro/g15macro.c
Modified: trunk/g15daemon-clients/g15macro/g15macro.c
===================================================================
--- trunk/g15daemon-clients/g15macro/g15macro.c 2008-01-23 08:05:30 UTC (rev 444)
+++ trunk/g15daemon-clients/g15macro/g15macro.c 2008-01-23 08:26:23 UTC (rev 445)
@@ -984,8 +984,9 @@
if(display_timeout<=0){
int fg_check = g15_send_cmd (g15screen_fd, G15DAEMON_IS_FOREGROUND, dummy);
if (fg_check==1) { // foreground
- g15_send_cmd (g15screen_fd, G15DAEMON_SWITCH_PRIORITIES, dummy);
- g15r_loadWbmpSplash(canvas, splashpath);
+ do {
+ g15_send_cmd (g15screen_fd, G15DAEMON_SWITCH_PRIORITIES, dummy);
+ } while(g15_send_cmd (g15screen_fd, G15DAEMON_IS_FOREGROUND, dummy)==1);
}
usleep(500*1000);
@@ -1008,6 +1009,6 @@
change_keymap(0);
close(g15screen_fd);
close_and_exit:
- XCloseDisplay(dpy);
+ /* XCloseDisplay(dpy); */
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2008-01-23 08:05:26
|
Revision: 444
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=444&view=rev
Author: mlampard
Date: 2008-01-23 00:05:30 -0800 (Wed, 23 Jan 2008)
Log Message:
-----------
g15daemon 1.9x: send refresh on priority switch.
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2008-01-23 07:13:55 UTC (rev 443)
+++ trunk/g15daemon-wip/g15daemon/main.c 2008-01-23 08:05:30 UTC (rev 444)
@@ -90,10 +90,9 @@
if(value & G15_KEY_LIGHT){ // the backlight key was pressed - maintain user-selected state
lcd_t *displaying = lcd->masterlist->tail->lcd;
lcd->masterlist->kb_backlight_state++;
- if(lcd->masterlist->kb_backlight_state>2)
- lcd->masterlist->kb_backlight_state=0;
- displaying->backlight_state++;
- displaying->backlight_state %= 3; // limit to 0-2 inclusive
+ lcd->masterlist->kb_backlight_state %= 3;
+ displaying->backlight_state++;
+ displaying->backlight_state %= 3; // limit to 0-2 inclusive
}
if(value & G15_KEY_M1 && value & G15_KEY_M3) {
static int scr_num=0;
@@ -164,6 +163,7 @@
}
}
pthread_mutex_unlock(&lcdlist_mutex);
+ g15daemon_send_refresh((lcd_t*)lcdnode->list->current->lcd);
break;
}
case G15_EVENT_VISIBILITY_CHANGED:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2008-01-23 07:13:51
|
Revision: 443
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=443&view=rev
Author: mlampard
Date: 2008-01-22 23:13:55 -0800 (Tue, 22 Jan 2008)
Log Message:
-----------
g15daemon 1.9x: libg15daemon_client - kill application after writing backtrace.
Modified Paths:
--------------
trunk/g15daemon-wip/libg15daemon_client/g15daemon_net.c
Modified: trunk/g15daemon-wip/libg15daemon_client/g15daemon_net.c
===================================================================
--- trunk/g15daemon-wip/libg15daemon_client/g15daemon_net.c 2008-01-22 10:30:52 UTC (rev 442)
+++ trunk/g15daemon-wip/libg15daemon_client/g15daemon_net.c 2008-01-23 07:13:55 UTC (rev 443)
@@ -25,6 +25,7 @@
*/
#include <string.h>
+#include <stdlib.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/wait.h>
@@ -71,7 +72,7 @@
switch (sig) {
case SIGSEGV:
#ifdef HAVE_EXECINFO_H
- fprintf(stderr, "The application caught a Segmentation Fault. Backtrace follows:\n");
+ fprintf(stderr, "The application (or it's libraries) caught a Segmentation Fault. Backtrace follows:\n");
nptrs = backtrace(buf,BACKTRACE_LEN);
btfuncs = backtrace_symbols(buf,nptrs);
@@ -80,8 +81,9 @@
for(i=0;i<nptrs;i++)
fprintf(stderr,"Backtrace: %s\n",btfuncs[i]);
-
+ fprintf(stderr,"End of Backtrace.\n");
free(btfuncs);
+ exit(1);
#endif
break;
}
@@ -99,7 +101,7 @@
char buffer[256];
if(sighandler_init==0) {
-#ifdef HAVE_BACKTRACE
+#ifdef HAVE_BACKTRACE
new_sigaction.sa_handler = g15_sighandler;
new_sigaction.sa_flags = 0;
sigaction(SIGSEGV,&new_sigaction,NULL);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2008-01-22 10:30:48
|
Revision: 442
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=442&view=rev
Author: mlampard
Date: 2008-01-22 02:30:52 -0800 (Tue, 22 Jan 2008)
Log Message:
-----------
g15daemon 1.9x: ensure lcd is updated on client removal.
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/linked_lists.c
Modified: trunk/g15daemon-wip/g15daemon/linked_lists.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/linked_lists.c 2008-01-22 10:09:21 UTC (rev 441)
+++ trunk/g15daemon-wip/g15daemon/linked_lists.c 2008-01-22 10:30:52 UTC (rev 442)
@@ -188,6 +188,7 @@
(*prev)->next = (*masterlist)->tail;
(*masterlist)->head = oldnode->prev;
}
+ g15daemon_send_refresh((*masterlist)->current->lcd);
free(oldnode);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2008-01-22 10:09:16
|
Revision: 441
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=441&view=rev
Author: mlampard
Date: 2008-01-22 02:09:21 -0800 (Tue, 22 Jan 2008)
Log Message:
-----------
g15daemon 1.9x: lcd->ident is no longer required. remove.
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/g15daemon.h
trunk/g15daemon-wip/g15daemon/main.c
trunk/g15daemon-wip/g15daemon/utility_funcs.c
Modified: trunk/g15daemon-wip/g15daemon/g15daemon.h
===================================================================
--- trunk/g15daemon-wip/g15daemon/g15daemon.h 2008-01-22 09:15:04 UTC (rev 440)
+++ trunk/g15daemon-wip/g15daemon/g15daemon.h 2008-01-22 10:09:21 UTC (rev 441)
@@ -172,7 +172,6 @@
int max_x;
int max_y;
int connection;
- long int ident;
unsigned int backlight_state;
unsigned int mkey_state;
unsigned int contrast_state;
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2008-01-22 09:15:04 UTC (rev 440)
+++ trunk/g15daemon-wip/g15daemon/main.c 2008-01-22 10:09:21 UTC (rev 441)
@@ -223,7 +223,6 @@
static void *lcd_draw_thread(void *lcdlist){
g15daemon_t *masterlist = (g15daemon_t*)(lcdlist);
- static long int lastlcd = 1;
static unsigned int lastscreentime;
/* unsigned int fps = 0; */
lcd_t *displaying = masterlist->tail->lcd;
@@ -239,21 +238,18 @@
pthread_mutex_lock(&lcdlist_mutex);
displaying = masterlist->current->lcd;
- if(displaying->ident != lastlcd){
- /* monitor 'fps' - due to the TCP protocol, some frames will be bunched up.
- discard excess to reduce load on the bus */
- /* fps = 1000 / (g15daemon_gettime_ms() - lastscreentime); */
- /* if the current screen is less than 20ms from the previous (equivelant to 50fps) delay it */
- /* this allows a real-world fps of 40fps with no almost frame loss and reduces peak usb bus-load */
+ /* monitor 'fps' - due to the TCP protocol, some frames will be bunched up.
+ discard excess to reduce load on the bus */
+ /* fps = 1000 / (g15daemon_gettime_ms() - lastscreentime); */
+ /* if the current screen is less than 20ms from the previous (equivelant to 50fps) delay it */
+ /* this allows a real-world fps of 40fps with no almost frame loss and reduces peak usb bus-load */
- if((g15daemon_gettime_ms() - lastscreentime)>=20||(char*)displaying!=lastdisplayed){
- g15daemon_log(LOG_DEBUG,"Updating LCD");
- uf_write_buf_to_g15(displaying);
- lastscreentime = g15daemon_gettime_ms();
- lastdisplayed = (char*)displaying;
- lastlcd = displaying->ident;
- g15daemon_log(LOG_DEBUG,"LCD Update Complete");
- }
+ if((g15daemon_gettime_ms() - lastscreentime)>=20||(char*)displaying!=lastdisplayed){
+ g15daemon_log(LOG_DEBUG,"Updating LCD");
+ uf_write_buf_to_g15(displaying);
+ lastscreentime = g15daemon_gettime_ms();
+ lastdisplayed = (char*)displaying;
+ g15daemon_log(LOG_DEBUG,"LCD Update Complete");
}
if(displaying->state_changed){
Modified: trunk/g15daemon-wip/g15daemon/utility_funcs.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/utility_funcs.c 2008-01-22 09:15:04 UTC (rev 440)
+++ trunk/g15daemon-wip/g15daemon/utility_funcs.c 2008-01-22 10:09:21 UTC (rev 441)
@@ -82,9 +82,6 @@
}
void g15daemon_send_refresh(lcd_t *lcd) {
- struct timeval t;
- gettimeofday(&t,NULL);
- lcd->ident=t.tv_usec+random();
if(lcd==lcd->masterlist->current->lcd||lcd->state_changed)
pthread_cond_broadcast(&lcd_refresh);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2008-01-22 09:14:59
|
Revision: 440
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=440&view=rev
Author: mlampard
Date: 2008-01-22 01:15:04 -0800 (Tue, 22 Jan 2008)
Log Message:
-----------
g15daemon 1.9x: add display thread notification on state change.
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/utility_funcs.c
Modified: trunk/g15daemon-wip/g15daemon/utility_funcs.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/utility_funcs.c 2008-01-22 08:53:30 UTC (rev 439)
+++ trunk/g15daemon-wip/g15daemon/utility_funcs.c 2008-01-22 09:15:04 UTC (rev 440)
@@ -85,7 +85,7 @@
struct timeval t;
gettimeofday(&t,NULL);
lcd->ident=t.tv_usec+random();
- if(lcd==lcd->masterlist->current->lcd)
+ if(lcd==lcd->masterlist->current->lcd||lcd->state_changed)
pthread_cond_broadcast(&lcd_refresh);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|