3 Copyright 2008 - 2009 by 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 mixToStereo(long, int);
96 void setShouldRecord();
106 AudioFileWriter
*writer
;
112 QPointer
<QObject
> confirmation
;
113 QDateTime timeStartRecording
;
119 QTcpServer
*serverLocal
, *serverRemote
;
120 QTcpSocket
*socketLocal
, *socketRemote
;
121 QByteArray bufferLocal
, bufferRemote
;
128 void checkConnections();
130 void tryToWrite(bool = false);
131 void confirmRecording();
132 void denyRecording();
134 private: // moc gets confused without this private:
135 DISABLE_COPY_AND_ASSIGNMENT(Call
);
138 class CallHandler
: public QObject
{
141 CallHandler(QObject
*, Skype
*);
143 void callCmd(const QStringList
&);
146 // note that {start,stop}Recording signals are not guaranteed to always
147 // happen within a {start,stop}Call block. Especially,
148 // stoppedRecording will usually happen *after* stoppedCall
149 void startedCall(int, const QString
&);
150 void stoppedCall(int);
151 void startedRecording(int);
152 void stoppedRecording(int);
155 void startRecording(int);
156 void stopRecording(int);
157 void stopRecordingAndDelete(int);
160 void showLegalInformation();
166 typedef QMap
<CallID
, Call
*> CallMap
;
167 typedef QSet
<CallID
> CallSet
;
172 QPointer
<LegalInformationDialog
> legalInformationDialog
;
174 DISABLE_COPY_AND_ASSIGNMENT(CallHandler
);