3 Copyright (C) 2008 jlh (jlh at gmx dot ch)
5 This program is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by the
7 Free Software Foundation; either version 2 of the License, version 3 of
8 the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 The GNU General Public License version 2 is included with the source of
20 this program under the file name COPYING. You can also get a copy on
37 class AudioFileWriter
;
40 class LegalInformationDialog
;
44 class Call
: public QObject
{
47 Call(QObject
*, Skype
*, CallID
);
49 void startRecording(bool = false);
50 void stopRecording(bool = true);
51 bool okToDelete() const;
52 void setStatus(const QString
&);
53 QString
getStatus() const { return status
; }
54 bool statusDone() const;
55 bool statusActive() const;
56 CallID
getID() const { return id
; }
58 void hideConfirmation(int);
61 void startedCall(int, const QString
&);
62 void stoppedCall(int);
63 void startedRecording(int);
64 void stoppedRecording(int);
65 void showLegalInformation();
68 QString
constructFileName() const;
69 QString
constructCommentTag() const;
71 void setShouldRecord();
80 AudioFileWriter
*writer
;
85 QPointer
<QObject
> confirmation
;
86 QDateTime timeStartRecording
;
88 QTcpServer
*serverLocal
, *serverRemote
;
89 QTcpSocket
*socketLocal
, *socketRemote
;
90 QByteArray bufferLocal
, bufferRemote
;
91 QByteArray bufferMono
;
98 void checkConnections();
100 void tryToWrite(bool = false);
101 void confirmRecording();
102 void denyRecording();
107 Call
&operator=(const Call
&);
110 class CallHandler
: public QObject
{
113 CallHandler(QObject
*, Skype
*);
115 void callCmd(const QStringList
&);
118 // note that {start,stop}Recording signals are not guaranteed to always
119 // happen within a {start,stop}Call block. Especially,
120 // stoppedRecording will usually happen *after* stoppedCall
121 void startedCall(int, const QString
&);
122 void stoppedCall(int);
123 void startedRecording(int);
124 void stoppedRecording(int);
127 void startRecording(int);
128 void stopRecording(int);
129 void stopRecordingAndDelete(int);
132 void showLegalInformation();
138 typedef QMap
<CallID
, Call
*> CallMap
;
139 typedef QSet
<CallID
> CallSet
;
144 QPointer
<LegalInformationDialog
> legalInformationDialog
;