aboutsummaryrefslogtreecommitdiffstats
path: root/src/kvilib/ext/avdevice/videodevicevector.cpp
diff options
context:
space:
mode:
authorGravatar Fabio Bas2009-11-12 15:12:14 +0000
committerGravatar Fabio Bas2009-11-12 15:12:14 +0000
commitadfa9fbec1f3fe1a4827e84d3ede0b141fee4d79 (patch)
tree10efcc82dbe63b6a4411be7adff98a5a6013c976 /src/kvilib/ext/avdevice/videodevicevector.cpp
parent[KVIrc] (trunk) Add -lXrender to ${LIBS} if built with X11/Xrender support. (diff)
downloadKVIrc-adfa9fbec1f3fe1a4827e84d3ede0b141fee4d79.tar.gz
KVIrc-adfa9fbec1f3fe1a4827e84d3ede0b141fee4d79.tar.bz2
KVIrc-adfa9fbec1f3fe1a4827e84d3ede0b141fee4d79.zip
first shy implementation of dcc video; highly instable and bandwitdth-sucker, bad coded, puppy-killer, you've been warned.
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@3597 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/kvilib/ext/avdevice/videodevicevector.cpp')
-rw-r--r--src/kvilib/ext/avdevice/videodevicevector.cpp88
1 files changed, 88 insertions, 0 deletions
diff --git a/src/kvilib/ext/avdevice/videodevicevector.cpp b/src/kvilib/ext/avdevice/videodevicevector.cpp
new file mode 100644
index 000000000..4edc96c39
--- /dev/null
+++ b/src/kvilib/ext/avdevice/videodevicevector.cpp
@@ -0,0 +1,88 @@
+//=============================================================================
+//
+// File : videodevicevector.cpp
+// Creation date : Tue Nov 10 18:08:09 2009 GMT by Fabio Bas
+//
+// This file is part of the KVirc irc client distribution
+// Copyright (C) 2009 Szymon Stefanek (pragma at kvirc dot net)
+//
+// This program is FREE software. You can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your opinion) any later version.
+//
+// This program is distributed in the HOPE that it will be USEFUL,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+// See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, write to the Free Software Foundation,
+// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+// This file has been taken from the "Kopete, The KDE Instant Messenger"
+// sourcecode. Original copyright of the file follows:
+//=============================================================================
+
+/*
+ videodevicevector.cpp - Kopete Video Device List Abstration
+
+ Copyright (c) 2009 by Alan Jones <skyphyr@gmail.com>
+
+ Kopete (c) 2002-2009 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * This library is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU General Public *
+ * License as published by the Free Software Foundation; either *
+ * version 3 of the License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program. If not, see <http://www.gnu.org/licenses/>. *
+ *************************************************************************
+*/
+
+#include "videodevicevector.h"
+
+namespace Kopete {
+
+namespace AV {
+
+VideoDevice& VideoDeviceVector::operator[] (int i)
+ {
+ if (i>=size())
+ {
+ //we're outside the range so let's return a default camera not available VideoDevice
+ return fallback;
+ }
+
+ //if we've made it here then we're within range
+ return QVector<VideoDevice>::operator[](i);
+ }
+
+const VideoDevice& VideoDeviceVector::operator[] (int i) const
+ {
+ return at(i);
+ }
+
+const VideoDevice& VideoDeviceVector::at(int i) const
+ {
+ if (i>=size())
+ {
+ //we're outside the range so let's return a default camera not available VideoDevice
+ return fallback;
+ }
+
+ //if we've made it here then we're within range
+ return QVector<VideoDevice>::operator[](i);
+ }
+
+}
+
+}