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
;
67 DISABLE_COPY_AND_ASSIGNMENT(AutoSync
);
70 class Call
: public QObject
{
73 Call(CallHandler
*, Skype
*, CallID
);
75 void startRecording(bool = false);
76 void stopRecording(bool = true);
78 bool okToDelete() const;
79 void setStatus(const QString
&);
80 QString
getStatus() const { return status
; }
81 bool statusDone() const;
82 bool statusActive() const;
83 CallID
getID() const { return id
; }
84 CallID
getConfID() const { return confID
; }
86 void hideConfirmation(int);
87 bool getIsRecording() const { return isRecording
; }
90 void startedCall(int, const QString
&);
91 void stoppedCall(int);
92 void startedRecording(int);
93 void stoppedRecording(int);
94 void showLegalInformation();
97 QString
constructFileName() const;
98 QString
constructCommentTag() const;
100 void mixToStereo(long, int);
101 void setShouldRecord();
107 CallHandler
*handler
;
113 AudioFileWriter
*writer
;
119 QPointer
<QObject
> confirmation
;
120 QDateTime timeStartRecording
;
126 QTcpServer
*serverLocal
, *serverRemote
;
127 QTcpSocket
*socketLocal
, *socketRemote
;
128 QByteArray bufferLocal
, bufferRemote
;
135 void checkConnections();
137 void tryToWrite(bool = false);
138 void confirmRecording();
139 void denyRecording();
141 private: // moc gets confused without this private:
142 DISABLE_COPY_AND_ASSIGNMENT(Call
);
145 class CallHandler
: public QObject
{
148 CallHandler(QObject
*, Skype
*);
150 void updateConfIDs();
151 bool isConferenceRecording(CallID
) const;
152 void callCmd(const QStringList
&);
155 // note that {start,stop}Recording signals are not guaranteed to always
156 // happen within a {start,stop}Call block. Especially,
157 // stoppedRecording will usually happen *after* stoppedCall
158 void startedCall(int, const QString
&);
159 void stoppedCall(int);
160 void startedRecording(int);
161 void stoppedRecording(int);
164 void startRecording(int);
165 void stopRecording(int);
166 void stopRecordingAndDelete(int);
169 void showLegalInformation();
175 typedef QMap
<CallID
, Call
*> CallMap
;
176 typedef QSet
<CallID
> CallSet
;
181 QPointer
<LegalInformationDialog
> legalInformationDialog
;
183 DISABLE_COPY_AND_ASSIGNMENT(CallHandler
);