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
41 class AudioFileWriter
;
44 class LegalInformationDialog
;
65 DISABLE_COPY_AND_ASSIGNMENT(AutoSync
);
68 class Call
: public QObject
{
71 Call(QObject
*, Skype
*, CallID
);
73 void startRecording(bool = false);
74 void stopRecording(bool = true);
75 bool okToDelete() const;
76 void setStatus(const QString
&);
77 QString
getStatus() const { return status
; }
78 bool statusDone() const;
79 bool statusActive() const;
80 CallID
getID() const { return id
; }
82 void hideConfirmation(int);
85 void startedCall(int, const QString
&);
86 void stoppedCall(int);
87 void startedRecording(int);
88 void stoppedRecording(int);
89 void showLegalInformation();
92 QString
constructFileName() const;
93 QString
constructCommentTag() const;
95 void setShouldRecord();
105 AudioFileWriter
*writer
;
110 QPointer
<QObject
> confirmation
;
111 QDateTime timeStartRecording
;
117 QTcpServer
*serverLocal
, *serverRemote
;
118 QTcpSocket
*socketLocal
, *socketRemote
;
119 QByteArray bufferLocal
, bufferRemote
;
120 QByteArray bufferMono
;
127 void checkConnections();
129 void tryToWrite(bool = false);
130 void confirmRecording();
131 void denyRecording();
133 private: // moc gets confused without this private:
134 DISABLE_COPY_AND_ASSIGNMENT(Call
);
137 class CallHandler
: public QObject
{
140 CallHandler(QObject
*, Skype
*);
142 void callCmd(const QStringList
&);
145 // note that {start,stop}Recording signals are not guaranteed to always
146 // happen within a {start,stop}Call block. Especially,
147 // stoppedRecording will usually happen *after* stoppedCall
148 void startedCall(int, const QString
&);
149 void stoppedCall(int);
150 void startedRecording(int);
151 void stoppedRecording(int);
154 void startRecording(int);
155 void stopRecording(int);
156 void stopRecordingAndDelete(int);
159 void showLegalInformation();
165 typedef QMap
<CallID
, Call
*> CallMap
;
166 typedef QSet
<CallID
> CallSet
;
171 QPointer
<LegalInformationDialog
> legalInformationDialog
;
173 DISABLE_COPY_AND_ASSIGNMENT(CallHandler
);