File: cd-misc.c

package info (click to toggle)
dcd 0.99-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 296 kB
  • ctags: 627
  • sloc: ansic: 4,137; makefile: 91
file content (31 lines) | stat: -rw-r--r-- 866 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
 * This is part of DCD, Dave's CD Player.
 * (C) 1998-2001 David E. Smith <dave@technopagan.org>
 * Released under GNU GPL v2. (See 'COPYING' for details.)
 */

/* These are weird miscellaneous bits of CD handling code that don't
 * really fit anywhere else...
 */

#include "libcdplay.h"
#include "cd-misc.h"
#include <sys/types.h>

u_char cd_play_next_track(void) {
  u_char target_track;
  u_char cur_track = cd_current_track();
  if (cur_track >= cd_last_track()) target_track = cd_first_track();
     else target_track = (cur_track + 1);
  cd_play_disc(target_track);
  return target_track;
}

u_char cd_play_prev_track(void) {
  u_char target_track;
  u_char cur_track = cd_current_track();
  if (cur_track <= cd_first_track()) target_track = cd_last_track();
     else target_track = (cur_track - 1);
  cd_play_disc(target_track);
  return target_track;
}