1
/***************************************************************************
2
textinput.cpp - description
5
copyright : (C) 2001 by Volker Schroer
7
***************************************************************************/
9
/***************************************************************************
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 Wheatly, AE4JY *
16
***************************************************************************/
18
#include "textinput.h"
23
TextInput::TextInput(int ptt = -1):Input(ptt)
26
TextInput::~TextInput()
30
/** Opens the Device for writting, for Textfiles this means write nothing ! */
31
bool TextInput::open_Device_write(QString Device)
34
const char name[]="RTTY.out";
35
fd=open(name,O_RDWR|O_CREAT|O_TRUNC,S_IRWXU);
45
/** gets the samples from the device */
46
int TextInput::getSamples(double *sample,int anzahl)
58
i= read(fd,&Buf[pos],sizeof(Buf[0]));
59
while ( (i == 1) && (Buf[pos++] != '\n') && (pos <128) );
63
qWarning("Input file has strange lines\n");
80
/** puts the Samples onto the Device, for a Textmode Device nothing happens */
81
int TextInput::putSamples(double *sample,int anzahl)
88
s.setNum((int) sample[i]);
89
write(fd,s.latin1(),s.length());
97
void TextInput::PTT(bool mode)
101
bool TextInput::setParams(QString *errorstring)