[BACK]Return to dev.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / aucat

Diff for /src/usr.bin/aucat/Attic/dev.c between version 1.78 and 1.79

version 1.78, 2012/04/04 11:16:24 version 1.79, 2012/04/11 06:05:43
Line 89 
Line 89 
 int  devctl_open(struct dev *, struct devctl *);  int  devctl_open(struct dev *, struct devctl *);
   
 struct dev *dev_list = NULL;  struct dev *dev_list = NULL;
 unsigned dev_sndnum = 0, dev_thrnum = 0;  unsigned int dev_sndnum = 0, dev_thrnum = 0;
   
 #ifdef DEBUG  #ifdef DEBUG
 void  void
Line 109 
Line 109 
  * Create a sndio device   * Create a sndio device
  */   */
 struct dev *  struct dev *
 dev_new(char *path, unsigned mode,  dev_new(char *path, unsigned int mode, unsigned int bufsz, unsigned int round,
     unsigned bufsz, unsigned round, unsigned hold, unsigned autovol)      unsigned int hold, unsigned int autovol)
 {  {
         struct dev *d;          struct dev *d;
         unsigned *pnum, i;          unsigned int *pnum, i;
   
         pnum = (mode & MODE_THRU) ? &dev_thrnum : &dev_sndnum;          pnum = (mode & MODE_THRU) ? &dev_thrnum : &dev_sndnum;
         if (*pnum == DEV_NMAX) {          if (*pnum == DEV_NMAX) {
Line 164 
Line 164 
  * adjust device parameters and mode   * adjust device parameters and mode
  */   */
 void  void
 dev_adjpar(struct dev *d, unsigned mode,  dev_adjpar(struct dev *d, unsigned int mode,
     struct aparams *ipar, struct aparams *opar)      struct aparams *ipar, struct aparams *opar)
 {  {
         d->reqmode |= (mode | MODE_MIDIMASK);          d->reqmode |= (mode | MODE_MIDIMASK);
Line 198 
Line 198 
  * Add a MIDI port to the device   * Add a MIDI port to the device
  */   */
 int  int
 devctl_add(struct dev *d, char *path, unsigned mode)  devctl_add(struct dev *d, char *path, unsigned int mode)
 {  {
         struct devctl *c;          struct devctl *c;
   
Line 255 
Line 255 
         struct aparams par;          struct aparams par;
         struct aproc *conv;          struct aproc *conv;
         struct abuf *buf;          struct abuf *buf;
         unsigned siomode, cmin, cmax, rate;          unsigned int siomode, cmin, cmax, rate;
   
         d->mode = d->reqmode;          d->mode = d->reqmode;
         d->round = d->reqround;          d->round = d->reqround;
Line 666 
Line 666 
 void  void
 dev_drain(struct dev *d)  dev_drain(struct dev *d)
 {  {
         unsigned i;          unsigned int i;
         struct ctl_slot *s;          struct ctl_slot *s;
   
         for (i = 0, s = d->slot; i < CTL_NSLOT; i++, s++) {          for (i = 0, s = d->slot; i < CTL_NSLOT; i++, s++) {
Line 715 
Line 715 
         }          }
 }  }
   
 unsigned  unsigned int
 dev_roundof(struct dev *d, unsigned newrate)  dev_roundof(struct dev *d, unsigned int newrate)
 {  {
         return (d->round * newrate + d->rate / 2) / d->rate;          return (d->round * newrate + d->rate / 2) / d->rate;
 }  }
Line 902 
Line 902 
  */   */
 int  int
 dev_getep(struct dev *d,  dev_getep(struct dev *d,
     unsigned mode, struct abuf **sibuf, struct abuf **sobuf)      unsigned int mode, struct abuf **sibuf, struct abuf **sobuf)
 {  {
         struct abuf *ibuf, *obuf;          struct abuf *ibuf, *obuf;
   
Line 974 
Line 974 
  * them underruns/overruns).   * them underruns/overruns).
  */   */
 void  void
 dev_sync(struct dev *d, unsigned mode, struct abuf *ibuf, struct abuf *obuf)  dev_sync(struct dev *d, unsigned int mode,
       struct abuf *ibuf, struct abuf *obuf)
 {  {
         int delta, offs;          int delta, offs;
         struct abuf *mbuf = NULL;          struct abuf *mbuf = NULL;
Line 1026 
Line 1027 
  * return the current latency (in frames), ie the latency that   * return the current latency (in frames), ie the latency that
  * a stream would have if dev_attach() is called on it.   * a stream would have if dev_attach() is called on it.
  *   *
  * XXX: return a "unsigned", since result is always positive, isn't it?   * XXX: return a "unsigned int", since result is always positive, isn't it?
  */   */
 int  int
 dev_getpos(struct dev *d)  dev_getpos(struct dev *d)
Line 1047 
Line 1048 
  * and rec.   * and rec.
  */   */
 void  void
 dev_attach(struct dev *d, char *name, unsigned mode,  dev_attach(struct dev *d, char *name, unsigned int mode,
     struct abuf *ibuf, struct aparams *sipar, unsigned inch,      struct abuf *ibuf, struct aparams *sipar, unsigned int inch,
     struct abuf *obuf, struct aparams *sopar, unsigned onch,      struct abuf *obuf, struct aparams *sopar, unsigned int onch,
     unsigned xrun, int vol)      unsigned int xrun, int vol)
 {  {
         struct aparams ipar, opar;          struct aparams ipar, opar;
         struct aproc *conv;          struct aproc *conv;
         unsigned round, nblk, nch;          unsigned int round, nblk, nch;
   
 #ifdef DEBUG  #ifdef DEBUG
         if ((!APROC_OK(d->mix)    && (mode & MODE_PLAY)) ||          if ((!APROC_OK(d->mix)    && (mode & MODE_PLAY)) ||
Line 1324 
Line 1325 
         char *s;          char *s;
         struct ctl_slot *slot;          struct ctl_slot *slot;
         char name[CTL_NAMEMAX];          char name[CTL_NAMEMAX];
         unsigned i, unit, umap = 0;          unsigned int i, unit, umap = 0;
         unsigned ser, bestser, bestidx;          unsigned int ser, bestser, bestidx;
   
         /*          /*
          * create a ``valid'' control name (lowcase, remove [^a-z], trucate)           * create a ``valid'' control name (lowcase, remove [^a-z], trucate)
Line 1483 
Line 1484 
  *      can work because all streams have a slot   *      can work because all streams have a slot
  */   */
 void  void
 dev_slotvol(struct dev *d, int slot, unsigned vol)  dev_slotvol(struct dev *d, int slot, unsigned int vol)
 {  {
 #ifdef DEBUG  #ifdef DEBUG
         if (debug_level >= 3) {          if (debug_level >= 3) {
Line 1507 
Line 1508 
 int  int
 dev_try(struct dev *d, int slot)  dev_try(struct dev *d, int slot)
 {  {
         unsigned i;          unsigned int i;
         struct ctl_slot *s;          struct ctl_slot *s;
   
         if (d->tstate != CTL_START) {          if (d->tstate != CTL_START) {
Line 1624 
Line 1625 
 void  void
 dev_mmcstop(struct dev *d)  dev_mmcstop(struct dev *d)
 {  {
         unsigned i;          unsigned int i;
         struct ctl_slot *s;          struct ctl_slot *s;
   
         switch (d->tstate) {          switch (d->tstate) {
Line 1662 
Line 1663 
  * relocate all slots simultaneously   * relocate all slots simultaneously
  */   */
 void  void
 dev_loc(struct dev *d, unsigned origin)  dev_loc(struct dev *d, unsigned int origin)
 {  {
         unsigned i;          unsigned int i;
         struct ctl_slot *s;          struct ctl_slot *s;
   
 #ifdef DEBUG  #ifdef DEBUG
Line 1707 
Line 1708 
 }  }
   
 void  void
 dev_master(struct dev *d, unsigned master)  dev_master(struct dev *d, unsigned int master)
 {  {
 #ifdef DEBUG  #ifdef DEBUG
         if (debug_level >= 3) {          if (debug_level >= 3) {

Legend:
Removed from v.1.78  
changed lines
  Added in v.1.79