diff options
author | gahr <gahr@FreeBSD.org> | 2008-06-28 04:58:02 +0800 |
---|---|---|
committer | gahr <gahr@FreeBSD.org> | 2008-06-28 04:58:02 +0800 |
commit | ddcbf354c14be4e051d6e81232698d96626f909d (patch) | |
tree | 620b831fc67eb924fa0fbc75dfc16c8fca93844f /audio | |
parent | 9f0dc6ee14d0e50de2515493e07749941c4e16c5 (diff) | |
download | freebsd-ports-graphics-ddcbf354c14be4e051d6e81232698d96626f909d.tar.gz freebsd-ports-graphics-ddcbf354c14be4e051d6e81232698d96626f909d.tar.zst freebsd-ports-graphics-ddcbf354c14be4e051d6e81232698d96626f909d.zip |
- Add volume handling capabilities
Diffstat (limited to 'audio')
-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 47fd1c2eb60..ad0aea3dbbf 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 0a2a2af9277..226bab93d59 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 00000000000..0fbb2521e55 --- /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) |