From 7b3c2bd1e8041c237bff5d9bfbb809f5784b2c7e Mon Sep 17 00:00:00 2001 From: "Tux3 / Mlkj / !Lev.uXFMLA" Date: Mon, 27 Oct 2014 00:31:51 +0100 Subject: [PATCH] Add some core doc comments, remove dead code --- src/core.cpp | 1 - src/core.h | 38 +++++++++++++++++--------------------- src/coreav.cpp | 12 ------------ 3 files changed, 17 insertions(+), 34 deletions(-) diff --git a/src/core.cpp b/src/core.cpp index 6f388d608..923bebbab 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -51,7 +51,6 @@ Core::Core(Camera* cam, QThread *coreThread, QString loadPath) : qDebug() << "Core: loading Tox from" << loadPath; videobuf = new uint8_t[videobufsize]; - videoBusyness=0; for (int i = 0; i < ptCounter; i++) pwsaltedkeys[i] = nullptr; diff --git a/src/core.h b/src/core.h index cf38f3280..5f67ec0c3 100644 --- a/src/core.h +++ b/src/core.h @@ -45,36 +45,33 @@ public: static const QString CONFIG_FILE_NAME; static QString sanitize(QString name); - int getGroupNumberPeers(int groupId) const; - QString getGroupPeerName(int groupId, int peerId) const; - QList getGroupPeerNames(int groupId) const; - QString getFriendAddress(int friendNumber) const; - QString getFriendUsername(int friendNumber) const; - int joinGroupchat(int32_t friendnumber, const uint8_t* friend_group_public_key,uint16_t length) const; - void quitGroupChat(int groupId) const; - void dispatchVideoFrame(vpx_image img) const; + int getGroupNumberPeers(int groupId) const; ///< Return the number of peers in the group chat on success, or -1 on failure + QString getGroupPeerName(int groupId, int peerId) const; ///< Get the name of a peer of a group + QList getGroupPeerNames(int groupId) const; ///< Get the names of the peers of a group + QString getFriendAddress(int friendNumber) const; ///< Get the full address if known, or Tox ID of a friend + QString getFriendUsername(int friendNumber) const; ///< Get the username of a friend + int joinGroupchat(int32_t friendNumber, const uint8_t* pubkey,uint16_t length) const; ///< Accept a groupchat invite + void quitGroupChat(int groupId) const; ///< Quit a groupchat void saveConfiguration(); void saveConfiguration(const QString& path); - QString getIDString(); + QString getIDString(); ///< Get the 12 first characters of our Tox ID - QString getUsername(); - QString getStatusMessage(); - ToxID getSelfId(); + QString getUsername(); ///< Returns our username, or an empty string on failure + QString getStatusMessage(); ///< Returns our status message, or an empty string on failure + ToxID getSelfId(); ///< Returns our Tox ID - VideoSource* getVideoSourceFromCall(int callNumber); - void increaseVideoBusyness(); - void decreaseVideoBusyness(); + VideoSource* getVideoSourceFromCall(int callNumber); ///< Get a call's video source - bool anyActiveCalls(); + bool anyActiveCalls(); ///< true is any calls are currently active (note: a call about to start is not yet active) bool isPasswordSet(PasswordType passtype); public slots: - void start(); - void process(); - void bootstrapDht(); - void switchConfiguration(const QString& profile); + void start(); ///< Initializes the core, must be called before anything else + void process(); ///< Processes toxcore events and ensure we stay connected, called by its own timer + void bootstrapDht(); ///< Connects us to the Tox network + void switchConfiguration(const QString& profile); ///< Load a different profile and restart the core void acceptFriendRequest(const QString& userId); void requestFriendship(const QString& friendAddress, const QString& message); @@ -260,7 +257,6 @@ private: static const int videobufsize; static uint8_t* videobuf; - static int videoBusyness; // Used to know when to drop frames static ALCdevice* alOutDev, *alInDev; static ALCcontext* alContext; diff --git a/src/coreav.cpp b/src/coreav.cpp index 8b1098f35..f64e79ddf 100644 --- a/src/coreav.cpp +++ b/src/coreav.cpp @@ -22,7 +22,6 @@ ToxCall Core::calls[TOXAV_MAX_CALLS]; const int Core::videobufsize{TOXAV_MAX_VIDEO_WIDTH * TOXAV_MAX_VIDEO_HEIGHT * 4}; uint8_t* Core::videobuf; -int Core::videoBusyness; ALCdevice* Core::alOutDev, *Core::alInDev; ALCcontext* Core::alContext; @@ -292,17 +291,6 @@ void Core::sendCallVideo(int callId) calls[callId].sendVideoTimer->start(); } - -void Core::increaseVideoBusyness() -{ - videoBusyness++; -} - -void Core::decreaseVideoBusyness() -{ - videoBusyness--; -} - void Core::micMuteToggle(int callId) { if (calls[callId].active) {