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
39 class AudioFileWriter
;
42 class LegalInformationDialog
;
46 class Call
: public QObject
{
49 Call(QObject
*, Skype
*, CallID
);
51 void startRecording(bool = false);
52 void stopRecording(bool = true);
53 bool okToDelete() const;
54 void setStatus(const QString
&);
55 QString
getStatus() const { return status
; }
56 bool statusDone() const;
57 bool statusActive() const;
58 CallID
getID() const { return id
; }
60 void hideConfirmation(int);
63 void startedCall(int, const QString
&);
64 void stoppedCall(int);
65 void startedRecording(int);
66 void stoppedRecording(int);
67 void showLegalInformation();
70 QString
constructFileName() const;
71 QString
constructCommentTag() const;
73 void setShouldRecord();
82 AudioFileWriter
*writer
;
87 QPointer
<QObject
> confirmation
;
88 QDateTime timeStartRecording
;
90 QTcpServer
*serverLocal
, *serverRemote
;
91 QTcpSocket
*socketLocal
, *socketRemote
;
92 QByteArray bufferLocal
, bufferRemote
;
93 QByteArray bufferMono
;
100 void checkConnections();
102 void tryToWrite(bool = false);
103 void confirmRecording();
104 void denyRecording();
106 private: // moc gets confused without this private:
107 DISABLE_COPY_AND_ASSIGNMENT(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
;
146 DISABLE_COPY_AND_ASSIGNMENT(CallHandler
);