Changeset 18209
- Timestamp:
- 10/12/12 20:21:48 (11 years ago)
- Location:
- titan/titan
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/titan/global.h
r18190 r18209 2450 2450 } 2451 2451 2452 int setsaturation(int value)2453 {2454 debug(1000, "in");2455 char* saturationdev;2456 2457 saturationdev = getconfig("saturationdev", NULL);2458 2459 if(saturationdev != NULL)2460 {2461 debug(100, "set %s to %d", saturationdev, value);2462 return writesysint(saturationdev, value, 1);2463 }2464 2465 debug(1000, "out");2466 return 0;2467 }2468 2469 int setbrightness(int value)2470 {2471 debug(1000, "in");2472 char* brightnessdev;2473 2474 brightnessdev = getconfig("brightnessdev", NULL);2475 2476 if(brightnessdev != NULL)2477 {2478 debug(100, "set %s to %d", brightnessdev, value);2479 return writesysint(brightnessdev, value, 1);2480 }2481 2482 debug(1000, "out");2483 return 0;2484 }2485 2486 2452 int setvmpeg(struct dvbdev* node, int posx, int posy, int width, int height) 2487 2453 { … … 2586 2552 } 2587 2553 2554 int checkdev(char* dev) 2555 { 2556 char* cmd = NULL; 2557 cmd = ostrcat(cmd, "cat ", 1, 0); 2558 cmd = ostrcat(cmd, dev, 1, 0); 2559 2560 char* tmpstr = NULL; 2561 tmpstr = string_newline(command(cmd)); 2562 free(cmd), cmd = NULL; 2563 2564 if(tmpstr == NULL) 2565 { 2566 return 0; 2567 } 2568 2569 if(ostrcmp(tmpstr, "Segmentation fault") == 0) 2570 { 2571 return 0; 2572 } 2573 2574 free(tmpstr), tmpstr = NULL; 2575 return 1; 2576 } 2577 2578 int setsaturation(int value) 2579 { 2580 debug(1000, "in"); 2581 char* saturationdev; 2582 2583 saturationdev = getconfig("saturationdev", NULL); 2584 2585 if(saturationdev != NULL && checkdev(saturationdev)) 2586 { 2587 debug(100, "set %s to %d", saturationdev, value); 2588 return writesysint(saturationdev, value, 1); 2589 } 2590 2591 debug(1000, "out"); 2592 return 0; 2593 } 2594 2595 int setbrightness(int value) 2596 { 2597 debug(1000, "in"); 2598 char* brightnessdev; 2599 2600 brightnessdev = getconfig("brightnessdev", NULL); 2601 2602 if(brightnessdev != NULL && checkdev(brightnessdev)) 2603 { 2604 debug(100, "set %s to %d", brightnessdev, value); 2605 return writesysint(brightnessdev, value, 1); 2606 } 2607 2608 debug(1000, "out"); 2609 return 0; 2610 } 2611 2588 2612 int setcontrast(int value) 2589 2613 { … … 2593 2617 contrastdev = getconfig("contrastdev", NULL); 2594 2618 2595 if(contrastdev != NULL )2619 if(contrastdev != NULL && checkdev(contrastdev)) 2596 2620 { 2597 2621 debug(100, "set %s to %d", contrastdev, value); … … 2610 2634 tintdev = getconfig("tintdev", NULL); 2611 2635 2612 if(tintdev != NULL )2636 if(tintdev != NULL && checkdev(tintdev)) 2613 2637 { 2614 2638 debug(100, "set %s to %d", tintdev, value); -
titan/titan/header.h
r18190 r18209 649 649 char* string_deltags(char* str); 650 650 char* readfromlinetoline(char* str, int start, int end, int flag); 651 int checkdev(char* dev); 651 652 652 653 //rcconfig.h
Note: See TracChangeset
for help on using the changeset viewer.