~ubuntu-branches/ubuntu/quantal/linpsk/quantal

« back to all changes in this revision

Viewing changes to linpsk/input.h

  • Committer: Bazaar Package Importer
  • Author(s): Bruce Walker
  • Date: 2002-02-06 11:43:38 UTC
  • Revision ID: james.westby@ubuntu.com-20020206114338-xqmjmhh01lpjm0g4
Tags: upstream-0.6.2
ImportĀ upstreamĀ versionĀ 0.6.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
                          input.h  -  description
 
3
                             -------------------
 
4
    begin                : Sat May 5 2001
 
5
    copyright            : (C) 2001 by Volker Schroer
 
6
    email                : DL1KSV@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
 *   based on the work of Moe Wheatley, AE4JY                              *
 
16
 ***************************************************************************/
 
17
 
 
18
#ifndef INPUT_H
 
19
#define INPUT_H
 
20
 
 
21
#include <qstring.h>
 
22
 
 
23
#include <sys/ioctl.h>
 
24
#include <unistd.h>
 
25
#include <fcntl.h>
 
26
 
 
27
/**Abstract base class for the different input devices like soundcard, textfile,  Wavfile
 
28
  *@author Volker Schroer
 
29
  */
 
30
 
 
31
class Input {
 
32
public: 
 
33
        Input(int ptt);
 
34
        virtual ~Input();
 
35
        
 
36
  /** Opens the Device named Device for reading */
 
37
  virtual bool open_Device_read(QString Device);
 
38
 
 
39
  /** Opens the Device named Device for writing */
 
40
  virtual bool open_Device_write(QString Device) = 0;
 
41
 
 
42
  /** Closes the open Device */
 
43
  virtual bool close_Device() ;
 
44
 
 
45
  /** Tries to read anzahl samples and returns the nuber of read samples */
 
46
  virtual int getSamples(double *sample,int anzahl) = 0;
 
47
 
 
48
  /** Tries to write anzahl samples and returns the nuber of written samples */
 
49
  virtual int putSamples(double *sample,int anzahl) = 0;
 
50
 
 
51
  /** Switches PTT */
 
52
  virtual void PTT(bool mode) = 0;
 
53
 
 
54
  /** Sets the neede Parameters and returns an Errorstring if unsuccessfull */
 
55
  virtual bool setParams(QString *errorstring) = 0;
 
56
 
 
57
protected:
 
58
        
 
59
        /** Filedescriptor of Input/Output Device */
 
60
        
 
61
int fd;
 
62
        /** Filedescriptor of PTT- Device */
 
63
int serial;     
 
64
};
 
65
 
 
66
#endif