kwave  18.07.70
PlayBackDevice.h
Go to the documentation of this file.
1 /***************************************************************************
2  PlayBackDevice.h - abstract base class for playback devices
3  -------------------
4  begin : Sat May 19 2001
5  copyright : (C) 2001 by Thomas Eschenbacher
6  email : Thomas.Eschenbacher@gmx.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef PLAY_BACK_DEVICE_H
19 #define PLAY_BACK_DEVICE_H
20 
21 #include "config.h"
22 
23 #include <QList>
24 #include <QString>
25 #include <QStringList>
26 
27 #include "libkwave/Sample.h"
28 #include "libkwave/String.h"
29 
30 namespace Kwave
31 {
32  class SampleArray;
33 
47  {
48  public:
49 
51  virtual ~PlayBackDevice() {}
52 
67  virtual QString open(const QString &device, double rate,
68  unsigned int channels, unsigned int bits,
69  unsigned int bufbase) = 0;
70 
77  virtual int write(const Kwave::SampleArray &samples) = 0;
78 
82  virtual int close() = 0;
83 
85  virtual QStringList supportedDevices() {
86  return QStringList();
87  }
88 
90  virtual QString fileFilter() { return _(""); }
91 
99  virtual QList<unsigned int> supportedBits(const QString &device) = 0;
100 
111  virtual int detectChannels(const QString &device,
112  unsigned int &min, unsigned int &max)
113  {
114  (void)device;
115  return min = max = 0;
116  }
117 
118  };
119 }
120 
121 #endif /* PLAY_BACK_DEVICE_H */
122 
123 //***************************************************************************
124 //***************************************************************************
virtual int write(const Kwave::SampleArray &samples)=0
Definition: App.h:33
virtual int detectChannels(const QString &device, unsigned int &min, unsigned int &max)
virtual QString fileFilter()
virtual QStringList supportedDevices()
virtual QList< unsigned int > supportedBits(const QString &device)=0
#define _(m)
Definition: memcpy.c:66
virtual QString open(const QString &device, double rate, unsigned int channels, unsigned int bits, unsigned int bufbase)=0
virtual int close()=0