FreeBSD Bugzilla – Attachment 14349 Details for
Bug 26962
Add ``next'' and ``previous'' commands to cdcontrol(1).
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.63 KB, created by
mux
on 2001-04-29 21:20:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
mux
Created:
2001-04-29 21:20:00 UTC
Size:
2.63 KB
patch
obsolete
>*** cdcontrol.c.old Sun Apr 29 21:33:09 2001 >--- cdcontrol.c Sun Apr 29 21:32:48 2001 >*************** >*** 69,74 **** >--- 69,76 ---- > #define CMD_SET 13 > #define CMD_STATUS 14 > #define CMD_CDID 15 >+ #define CMD_NEXT 16 >+ #define CMD_PREVIOUS 17 > #define STATUS_AUDIO 0x1 > #define STATUS_MEDIA 0x2 > #define STATUS_VOLUME 0x4 >*************** >*** 85,95 **** >--- 87,99 ---- > { CMD_HELP, "?", 1, 0 }, > { CMD_HELP, "help", 1, "" }, > { CMD_INFO, "info", 1, "" }, >+ { CMD_NEXT, "next", 1, "" }, > { CMD_PAUSE, "pause", 2, "" }, > { CMD_PLAY, "play", 1, "min1:sec1[.fram1] [min2:sec2[.fram2]]" }, > { CMD_PLAY, "play", 1, "track1[.index1] [track2[.index2]]" }, > { CMD_PLAY, "play", 1, "tr1 m1:s1[.f1] [[tr2] [m2:s2[.f2]]]" }, > { CMD_PLAY, "play", 1, "[#block [len]]" }, >+ { CMD_PREVIOUS, "previous", 2, "" }, > { CMD_QUIT, "quit", 1, "" }, > { CMD_RESET, "reset", 4, "" }, > { CMD_RESUME, "resume", 1, "" }, >*************** >*** 115,120 **** >--- 119,126 ---- > int get_vol __P((int *, int *)); > int status __P((int *, int *, int *, int *)); > int open_cd __P((void)); >+ int next __P((void)); >+ int previous __P((void)); > int play __P((char *arg)); > int info __P((char *arg)); > int cdid __P((void)); >*************** >*** 287,298 **** >--- 293,316 ---- > > return pstatus (arg); > >+ case CMD_NEXT: >+ if (fd < 0 && ! open_cd ()) >+ return (0); >+ >+ return next (); >+ > case CMD_PAUSE: > if (fd < 0 && ! open_cd ()) > return (0); > > return ioctl (fd, CDIOCPAUSE); > >+ case CMD_PREVIOUS: >+ if (fd < 0 && ! open_cd ()) >+ return (0); >+ >+ return previous (); >+ > case CMD_RESUME: > if (fd < 0 && ! open_cd ()) > return (0); >*************** >*** 1180,1183 **** >--- 1198,1245 ---- > err(1, "%s", devbuf); > } > return (1); >+ } >+ >+ int >+ next() >+ { >+ int trk; >+ struct ioc_toc_header h; >+ int rc, n; >+ >+ rc = ioctl(fd, CDIOREADTOCHEADER, &h); >+ >+ if (rc < 0) >+ return (rc); >+ >+ n = h.ending_track - h.starting_track + 1; >+ >+ if (status(&trk, &rc, &rc, &rc) < 0) >+ return (-1); >+ >+ if (++trk > h.ending_track) >+ trk = 1; >+ return play_track(trk, 1, n, 1); >+ } >+ >+ int >+ previous() >+ { >+ int trk; >+ struct ioc_toc_header h; >+ int rc, n; >+ >+ rc = ioctl(fd, CDIOREADTOCHEADER, &h); >+ >+ if (rc < 0) >+ return (rc); >+ >+ n = h.ending_track - h.starting_track + 1; >+ >+ if (status(&trk, &rc, &rc, &rc) < 0) >+ return (-1); >+ >+ if (--trk < 1) >+ trk = h.ending_track; >+ return play_track(trk, 1, n, 1); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 26962
: 14349 |
14350