diff options
author | Pietro Cerutti <gahr@FreeBSD.org> | 2008-06-27 20:58:02 +0000 |
---|---|---|
committer | Pietro Cerutti <gahr@FreeBSD.org> | 2008-06-27 20:58:02 +0000 |
commit | d066457c6325d4fc44fb8572418c3443709f18ad (patch) | |
tree | f8cc8f8664e8714f2ba4875d26eeb2eb16a21354 /audio/tcd | |
parent | 4277c3a2dd7a166a8dc7f3764c7f34b31b797511 (diff) | |
download | ports-d066457c6325d4fc44fb8572418c3443709f18ad.tar.gz ports-d066457c6325d4fc44fb8572418c3443709f18ad.zip |
- Add volume handling capabilities
Notes
Notes:
svn path=/head/; revision=215843
Diffstat (limited to 'audio/tcd')
-rw-r--r-- | audio/tcd/Makefile | 2 | ||||
-rw-r--r-- | audio/tcd/files/patch-tcd.c | 50 | ||||
-rw-r--r-- | audio/tcd/files/patch-user-interface.c | 15 |
3 files changed, 63 insertions, 4 deletions
diff --git a/audio/tcd/Makefile b/audio/tcd/Makefile index 47fd1c2eb603..ad0aea3dbbf3 100644 --- a/audio/tcd/Makefile +++ b/audio/tcd/Makefile @@ -7,7 +7,7 @@ PORTNAME= tcd PORTVERSION= 2.2.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= audio MASTER_SITES= ${MASTER_SITE_SAVANNAH} MASTER_SITE_SUBDIR= ${PORTNAME} diff --git a/audio/tcd/files/patch-tcd.c b/audio/tcd/files/patch-tcd.c index 0a2a2af92778..226bab93d59c 100644 --- a/audio/tcd/files/patch-tcd.c +++ b/audio/tcd/files/patch-tcd.c @@ -1,6 +1,41 @@ --- src/tcd.c.orig 2004-06-15 22:32:31.000000000 +0200 -+++ src/tcd.c 2008-06-27 01:25:01.000000000 +0200 -@@ -217,11 +217,11 @@ ++++ src/tcd.c 2008-06-27 22:55:04.000000000 +0200 +@@ -33,6 +33,7 @@ + #include <unistd.h> + + #include <SDL/SDL.h> ++#include <sys/cdio.h> + + #include "cd-utils.h" + #include "cddb.h" +@@ -179,6 +180,26 @@ + } + } + ++static void inc_volume(void) ++{ ++ struct ioc_vol arg; ++ if(ioctl(state.cdrom->id, CDIOCGETVOL, &arg) == -1) ++ return; ++ arg.vol[0] += arg.vol[0] > 250 ? 255 - arg.vol[0] : 5; ++ arg.vol[1] += arg.vol[1] > 250 ? 255 - arg.vol[1] : 5; ++ ioctl(state.cdrom->id, CDIOCSETVOL, &arg); ++} ++ ++static void dec_volume(void) ++{ ++ struct ioc_vol arg; ++ if(ioctl(state.cdrom->id, CDIOCGETVOL, &arg) == -1) ++ return; ++ arg.vol[0] -= arg.vol[0] < 5 ? arg.vol[0] : 5; ++ arg.vol[1] -= arg.vol[1] < 5 ? arg.vol[1] : 5; ++ ioctl(state.cdrom->id, CDIOCSETVOL, &arg); ++} ++ + static void init_SDL(int cdrom_num) + { + int err = SDL_Init(SDL_INIT_CDROM); +@@ -217,11 +238,11 @@ static void detect_disc_change(void) { unsigned long discid = cddb_discid(state.cdrom); @@ -14,7 +49,7 @@ state.current_discid = discid; } } -@@ -237,7 +237,7 @@ +@@ -237,7 +258,7 @@ state.play_method = NORMAL; init_SDL((argc > 1) ? strtol(argv[1], NULL, 0) : 0); @@ -23,3 +58,12 @@ tcd_ui_init(); tcd_ui_update(&state); state.current_discid = cddb_discid(state.cdrom); +@@ -262,6 +283,8 @@ + case 's': case 'S': handle_stop(); break; + case ']': handle_skip_forward(); break; + case '[': handle_skip_back(); break; ++ case '*': inc_volume(); break; ++ case '/': dec_volume(); break; + } + } + tcd_ui_shutdown(); diff --git a/audio/tcd/files/patch-user-interface.c b/audio/tcd/files/patch-user-interface.c new file mode 100644 index 000000000000..0fbb2521e55a --- /dev/null +++ b/audio/tcd/files/patch-user-interface.c @@ -0,0 +1,15 @@ +--- src/user-interface.c.orig 2008-06-27 22:55:46.000000000 +0200 ++++ src/user-interface.c 2008-06-27 22:55:49.000000000 +0200 +@@ -186,8 +186,10 @@ + phelp(3, 26, 'G', "- Go to track", playable); + phelp(4, 26, ']', "- Skip ahead", playable); + phelp(5, 26, '[', "- Skip back", playable); +- phelp(7, 1, 'T', "- Edit track database", playable); +- phelp(8, 1, 'Q', "- Quit", 1); ++ phelp(7, 1, '*', "- Increase volume", playable); ++ phelp(8, 1, '/', "- Decrease volume", playable); ++ phelp(10, 1, 'T', "- Edit track database", playable); ++ phelp(11, 1, 'Q', "- Quit", 1); + } + + static void draw_info(struct tcd_state *state) |